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.
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.
Share Improve this question edited Jan 12, 2012 at 15:00 Rarst 100k10 gold badges161 silver badges298 bronze badges asked Oct 24, 2011 at 20:01 NaatanNaatan 1191 gold badge1 silver badge3 bronze badges 3- Not sure why this got migrated here; it has nothing directly to do with WordPress. – Chip Bennett Commented Jan 11, 2012 at 19:50
- @Chip it has even less to do with programmers :) I ok-ed migration. IMO there are plenty of specifics to WP i18n approach and workflow to make this on topic. – Rarst Commented Jan 12, 2012 at 15:01
- @Rarst just because a question mentions WordPress does not mean that it is in our defined scope. This question is entirely about how to create translation files, and the answer is entirely independent of WordPress. WPSE has a very specific, defined scope. Approving migration of questions that are completely outside of that scope hurts our site, rather than helping it. – Chip Bennett Commented Jan 12, 2012 at 15:21
5 Answers
Reset to default 2I can find references on how to do it through the CLI but none of the GUI apps I've tried seem to support this.
Did you see Poedit? Cross-platform GUI for preparing and producing gettext-translations (with some limitation compared to fresh CLI-tools)
Is it common for the developer to just use the CLI to create these .pot files and then translators just provide the .po files?
Yes, CLI have more flexibility in some areas and isn't too hard to use (after learning curve)
Am I missing something? Are there no tools used that take care of the whole process?
Just learn Poedit (while xgettext&Co is still better)
I'm just trying to figure out how everyone does this with non-programmers in their team
Translators have Poedit (which they know how to use) and get updated pots, return changed po back
http://poeditor/ 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:
msgid "Something"
msgstr "Translation of Something"
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
msgfmt source.po -o destination.mo
For this command to run successfully on Ubuntu, you have to have gettext installed by doing
sudo apt-get install gettext
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:
sudo apt-get install gtranslator
The Codex has a pretty detailed overview of this topic:
http://codex.wordpress/Translating_WordPress#Localization_Technology