splitting a large po file into its smaller files

Events happening in the community are now at Drupal community events on www.drupal.org.
amuzulo's picture

I've been translating the Esperanto interface with the large eo.po and now have CVS access and know that I need to upload the file in its individual module file. How can I split a large language po file into the smaller module po files. Thanks!

I posted this to Drupal.org a few days ago with no reply. Could someone at least point me in the right direction?

Comments

A .po file is just a text

robertgarrigos's picture

A .po file is just a text file. You can split it with any plain text editor. You'll see that each translated string looks something like this:

#: event.module:154
msgid "Month"
msgstr "Mes"

As you can see the first line says which module that string belongs to. Just put all the same strings into the same file named module_name.po. That should do it.

Note that there is another way of translating .po files: each module should be released (some don't...) with a .pot file (template .po file) which you can use with any .po files editor to add a new translated .po file for that module.

And finally, you can always have a look to the translator's guide at the drupal's handbook page: http://drupal.org/node/11130 ;-)


Robert Garrigos
Professional site:robert.garrigos.cat


Robert Garrigós
Professional site: garrigos.cat

scripting is necessary?

amuzulo's picture

So, if I understand correctly, there's no easy way to do this besides writing a script to parse it and split it into its respective module files?

You need to use your

gerhard killesreiter's picture

You need to use your completed big PO file as a compendium for the smaller ones:

http://drupal.org/node/11311

for i in /path/to/drupal-pot/*.pot ; do msgmerge --compendium /path/to/your.po -o basename $i .pot.po /dev/null $i ; done

Translations

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: