So I’m trying to figure out how .po and .pot files work, seeing as this is what WordPress seems to use. But I can’t wrap my head around it.
I get that a .pot file is a template file that indicates what .po files need to have translations for. What I don’t get it how you’re supposed to add entries to these files?
I can find references on how to do it through the CLI but none of the GUI apps I’ve tried seem to support this. Is it common for the developer to just use the CLI to create these .pot files and then translators just provide the .po files?
Am I missing something? Are there no tools used that take care of the whole process?
It all looks good in theory but atm the whole process of managing translations just seems ridiculous, I’d expect an industry standard these days to be a bit more polished and user friendly.
I should note, I don’t have any problem understanding how to work it myself.. I’m just trying to figure out how everyone does this with non-programmers in their team. I can’t possibly ask them to open up their terminal and execute a bash command.
Did you see Poedit? Cross-platform GUI for preparing and producing gettext-translations (with some limitation compared to fresh CLI-tools)
Yes, CLI have more flexibility in some areas and isn’t too hard to use (after learning curve)
Just learn Poedit (while xgettext&Co is still better)
Translators have Poedit (which they know how to use) and get updated pots, return changed po back
http://poeditor.com/ is a web-based translation file editor that should meet your requirements. works with po, pot, xls, xlsx.
Take a look at Codestyling Localization plugin, that automates and provides interface for some of localization tasks right inside WP.
Editing .po files is easier than you can imagine. You can open a .po file by any text editor such as gedit on Linux or Notepad on Windows. After the header, you will see the following:
and the file goes on and on.
If you want to change couple of translations, then , use gedit on Linux or notepad on windows, open the file, and just change the text in quotes after msgstr. Then save the file.
The .po file then has to be changed to binary format (mo) so that the server can understand it. This is done using one simple command
For this command to run successfully on Ubuntu, you have to have gettext installed by doing
After generating the destination.mo file, you can just copy it to your server with the same name as the old .mo file (replacing it) and you are ready to go
I am using Gtranslator on Ubuntu. It seems to be much easier and better than POedit. to install on Ubuntu:
The Codex has a pretty detailed overview of this topic:
http://codex.wordpress.org/Translating_WordPress#Localization_Technology