Make a single file from loose .po files

Last modified: March 4, 2009 - 19:04

If you want to make a single po file from a CVS folder or a downloaded module from containing all the small .po files, the following commands will do.

UNIX

You should execute this (from a shell prompt) in the folder with the .po files.

$ msgcat --use-first  general.po [^g]*.po | msgattrib  --no-fuzzy -o nl.po

Of course, you should change nl into your own language code.

WINDOWS

Open the "Command Prompt" and type in the folder with the .po files.

for %f in (*.po) do type "%f" >> module.po

single po file to multiple module files

amuzulo - October 4, 2006 - 10:37

For those of you looking to split the large .po file into its respective module files:

http://drupal.org/node/11311

Combining all nl.po files

edvanleeuwen - January 18, 2009 - 14:04

Combining all nl.po files (*nix only) from the root of your Drupal installation: cat `find . -name *.nl.po` > total.po. Then import into the corresponding language (here Dutch as the prefix is 'nl').

Is there anything Bash can't do?

remi - February 18, 2009 - 15:12

Thank you so much for this snippet. My colleague and I were having the same problem as the one described at http://drupal.org/node/239477. We had to do it manually and merging all the content into one PO file using your command saved us a lot of time!

Rémi
remiplourde.com

 
 

Drupal is a registered trademark of Dries Buytaert.