19

I'm translating a wordpress site and need more clarity around these terms. Can anyone land a hand with some definitions and differences between .po .mo and .pot files with wordpress localization?

28

These are not any kind of WP's own format but rather just gettext file types which WP implements.

Translate Handbook has following definitions in its Glossary:

MO files: MO, or Machine Object is a binary data file that contains object data referenced by a program. It is typically used to translate program code, and may be loaded or imported into the GNU gettext program.

PO files: PO files are the files which contain the actual translations. Each language will have its own PO file, for example, for French there would be a fr.po file, for german there would be a de.po, for American English there might be en-US.po.

POT file: POT files are the template files for PO files. They will have all the translation strings left empty. A POT file is essentially an empty PO file without the translations, with just the original strings.

The technical details of file formats can be found in gettext documentation:

  • So, to understand it better, in a nutshell mo and pot files are left intact (mo file is essentially made automatically by using a program, for example poedit)? I still dont understand when we need a pot file.. – Yannis Dran Feb 27 '18 at 0:41
  • POT file is used whenever someone starts a new PO file for translation to a new language. So the workflow is POT (original strings) to PO (original strings and their translation to a specific language) to MO (compiled binary result). – Rarst Feb 27 '18 at 6:42
  • 1
    I would advise to just ask a new question. :) You are dragging your very specific problem (customization not working) into a very general questions (what are the file formats). – Rarst Feb 27 '18 at 13:11
  • 1
    @Er.AmitJoshi I have added links to technical details, if you are curious about internals. :) – Rarst Dec 11 '18 at 8:19
  • 1
    @landed yes, mo files are binary format, they are not supposed to be human-readable. – Rarst Nov 19 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.