WP Translations: mo and po files 9comments
Thanks for visiting! If you're new here, you may want to subscribe to our RSS feed. This blog posts regular Wordpress news, updates of themes, plugins, ideas, hacks, quick fixes and everything about blogging, especially about Wordpress. Go ahead, subscribe to our feed! You can also receive updates from this blog via email.
You can install Wordpress in various different languages and it is very easy to setup these translations. You can find more information on translating Wordpress into your own language on the Wordpress Codex. The Codex also has a lot of information on existing translated versions of Wordpress and the .mo language files. They are very simple to use. You just copy the .mo file to the wp-includes/languages folder and change/add the following line to add the filename of your language translation file
define ('WPLANG', '');
to
define ('WPLANG', 'es_ES');
if your language filename is es_ES.mo I suggest making this change before you install Wordpress.
This is all well and good, but this post is more about dispelling some of the myth and confusion surrounding .mo files. .mo files are not human readable by their nature and cannot be edited directly. You would need to install a version of poedit on your computer to be able to modify your language files and create new ones. There is detailed information on the Codex on where to start and what to do.
BUT .mo files can be decompiled into their .po counterparts which can then be edited using poedit. To convert .mo files into .po files, just cd to the bin directory of your poedit installation (in windows you have to use the command prompt) and use the following command
msgunfmt [path_to_file.mo] > [path_to_file.po]
Now you should be able to edit the po file created with poedit. Follow the Codex instructions at that point. You should not have to depend on anyone for the source of their .mo files if you need or want to make a change.










