Translate Toolkit & Pootle

Tools to help you make your software local

User Tools


Software >> WordPress >> Files

The wordpress.pot file is quite large at 15924 words. There are also additional text to be translated that do not exist in the offial POT file, which we added ourselves.

On this page we also tell you how to create the official PO file again, and how to do some useful pre-translation offline. This information is really only for translation leaders or people who don't use the Pootle server even though they use our files.

Also visit the main page for WordPress on this wiki.

The POT split into 9 files

To facilitate volunteer translation, we've broken the official wordpress.pot file up into nine smaller files based on the content of the strings. The way we did it, is described here.

  • admin_edit.pot (1583 words): All strings from the wp-admin location with “edit” in the location.
  • admin_import-export.pot (3404 words): All strings from the wp-admin location with “import” or “export”, but not “edit”, in the location.
  • admin_includes.pot (2467 words): All strings from the wp-admin location with “includes”, but not “import”, “export”, or “edit”, in the location.
  • admin_options.pot (1082 words): All strings from the wp-admin location with “options”, but not “includes”, “import”, “export”, or “edit”, in the location.
  • admin_everything-else.pot (2264 words): All other strings from the wp-admin location, in other words, without “options”, “includes”, “import”, “export” or “edit” in the location.
  • comments-and-content.pot (896 words): All strings from the wp-comments and wp-content locations, plus a few others.
  • includes-only-tiny.pot (1576 words): All strings from the wp-includes locations with “tiny” in the location (this is likely the public comments editor).
  • includes-without-tiny.pot (1540 words): All strings from the wp-includes locations, but not “tiny”, in the location.
  • login-etc.pot (1112 words): All other strings not extracted above.

Other PO files on Pootle

In addition to the above 9 files, there are three other PO files to be translated. The most important of these, is the terminology/glossary file.

  • pootle-terminology.pot (75 words): The 75 most used words in Wordpress, to be translated first.
  • readme.html.pot (851 words): The readme.html file included in the WordPress installation.
  • wordpress_PHP-additions.pot (355 words): The text in this file should actually be inserted into the PHP files manually, but it is provided here in PO format for each translation. See also “additional translations” below. This PO file does not contain the default theme.

The PHP Additions file (manual additions)

Not all translatable text is contained in the wordpress.pot file. Some of it has to be inserted manually by the translator in two PHP files, and there is also the readme.html file. We've taken all the strings from those two PHP files and put them in a PO file named wordpress_PHP-additions.pot, to make them easier to translate, but keep in mind that they should be inserted into the various PHP files manually.

The two PHP files and HTML file can be downloaded here.

Adding translations manually (from WP web site)

The following wording is quoted almost directly from the WordPress site:

  • readme.html: it's a static HTML file, not a PHP file, so it cannot be run through the gettext functions. The whole file needs to be translated.
  • wp-config-sample.php: translate the instructions in the PHP comments (so that someone who doesn't speak English can figure out how to configure WordPress), and set the WPLANG variable to the corret locale. For example, if you are using the bg_BG locale: define ('WPLANG', 'bg_BG');
  • wp-admin/setup-config.php: this is a script for automatic generation of wp-config.php, and as it runs independent of WordPress, there is no gettext. The whole file needs to be translated.

Generating/creating the official wordpress.po file

The Notepad method

The nine files contain no redundant or duplicate strings. This means that you can create the official wordpress.po file by simply downloading all nine files for your language and putting them all together in a single file (be careful not to duplicate the file headers, and make sure your final file does have a header).

The po2tmx/pot2po method

A different way of putting the translations from the nine files into the official wordpress.po file, is by creating a TM and pre-translating the official POT file. In fact, this can also be done if Wordpress should ever release a new POT file while you're still working on the old PO files.

Put the existing translations (PO files) in a folder, eg “mytranslations”. Using the Translate Toolkit, do this (where xx is your target language code):

po2tmx -l xx -i mytranslations -o myTM.tmx

Then, put myTM.tmx and wordpress.pot in a single folder, and do this:

pot2po --tm=myTM.tmx -i wordpress.pot -o wordpress_mylanguage.po

Since you're using a TMX file created by the Translate Toolkit itself, and not a TMX file you got from elsewhere, the pre-translation will be 100% successful. Strings for which no translations are found, will be translated with fuzzy matches (this can be disabled, read the helpfile).

Recreating the readme.html file

The readme.html.pot file was created using html2po. This particular tool in the Translate Toolkit is still in development and doesn't usually generate very elegant PO files. The WordPress readme.html is, however, very simple (probably on purpose!) and fits well with html2po.

To generate an HTML file from the PO file, you must make sure that you've got the original HTML file that the PO file was generated from. So hopefully you've saved a copy of it somewhere. But suppose there is no copy of it, what then? How can we ensure that the HTML file and the translated PO file correspond to each other? Simple… by regenerating the PO file first. Here's how:

If you have an existing, partially/fully translated PO file, generate a new PO file from the HTML file:

html2po -t old_readme.html.po -i readme.html -o new_readme.html.po

Now you can check the new PO file to see if everything is translated as it should be, and if you're happy with it, generate the HTML file from it:

po2html -t readme.html -i new_readme.html.po -o new_readme.html

Of course, if you're absolutely certain that you've got a copy of the original HTML file, you can safely skip the first command.