$Id: gettext.txt 1475 2007-11-07 15:11:25Z mjs $
WHAT'S THE DIFFERENCE BETWEEN .po AND .pot FILES?
Nothing, now:
Why doesn't xgettext create it under the name domainname.pot right away? The answer is: for historical reasons. When xgettext was specified, the distinction between a PO file and PO file template was fuzzy, and the suffix .pot' wasn't in use at that time.
http://www.gnu.org/software/gettext/manual/gettext.html#Template
HOW DO I CREATE A .po/.pot FILE?
You probably want something like:
find ../lib -name '.php' -o -name '.html' | \ xgettext --from-code=iso-8859-1 -kt -L PHP -o messages.pot -f -
See
http://www.gnu.org/software/gettext/manual/gettext.html#Template
HOW DO TRANSLATE A .pot FILE?/HOW DO I CREATE A .po FILE?
Essentially, you want to rename it to LANG.po, then edit it with some tool like Poedit. You can also use msginit:
msginit -l fr # defaults to reading from messages.pot, creates fr.po
See
http://www.gnu.org/software/gettext/manual/gettext.html#Creating
HOW DO I UPDATE A .pot FILE? (I.E. AFTER NEW STRINGS HAVE BEEN ADDED TO THE SOURCE.)
You first want to produce a new template file (can either rebuild it completely, or use the -j option to xgettext to update the existing one), then merge with each of the individual language files:
msgmerge -U -v LANG.po messages.pot
(-U for in-place edit, -v for verbose mode.)
Check the "fuzzy" matches--it often doesn't do a very good job! (Use -N to disable if necessary.)
See
http://www.gnu.org/software/gettext/manual/gettext.html#Updating