Feb 02

What is the difference between a .po and .pot file?

Here’s a quote from the GNU gettext utilities page:

After preparing the sources, the programmer creates a PO template file. This section explains how to use xgettext for this purpose.

xgettext creates a file named domainname.po. You should then rename it to domainname.pot. (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.)

So that’s it. It’s the same file, with a different name. Just thought I’d mention that, considering how much time I pissed off trying to find the answer!

[edit]
It looks like WordPress sees this a little differently. the POT file, the “PO” Template, is the raw output from the xgettext, untranslated. the PO file is the text-editable and edited pot file with the translations. the MO file is built with msgfmt (among others) and is what is actually used by php’s gettext.

  • Facebook
  • Share/Bookmark

Leave a Reply

preload preload preload