Building a site using Drupal 4.7.1 with Locale and Internationalization modules enabled. Using Mac OS10.4 and Terminal application to enter command lines.
I tried to insert strings from old 4.6 lv.po file to new 4.7 po files. I read about recycling old translations here: http://drupal.org/node/11311
but ran into a snag with the command line. Here is what I did based on instructions from above link:
1. Downloaded drupal-pot-4.7
2. Exported lv.po from my exisiting 4.6 Drupal site through admin/localization
3. Created new empty dir called lv-4.7 where I want to keep new po files
4. Used Terminal window to go to new empty lv-4.7 dir and typed in the following command:
for i in /Desktop/drupal-pot/*.pot; do msgmerge --compendium /Desktop/lv.po -o `basename $i .pot`.po /dev/null $i; done
This resulted in the following error message:
-bash: msgmerge: command not found
Can anyone help explain how to insert translated strings from an old po file into new 4.7 po files?
Comments
Import?
Wouldn't it be easier just to import the .po file like normal?
After I imported a .po translation for an older version of drupal - it grew by itself - adding all the new 4.7 terms with it...
I'm not sure if that is what you are after though...
-Nathan
thought I had to start with 4.7 pot files
Thanks for your suggestion. Based on what I read in the translator's guide, I thought the way to go was to:
1. Start fresh with the Drupal 4.7 pot files to make sure I had the latest version with all the needed strings.
2. Do a merge to insert all the translated strings from my older 4.6 po file into a new 4.7 po file
3. Then import this 4.7 po file into the new 4.7 site
Can anyone else tell me if I'm going about this wrong? Is it really ok just to import an old 4.6 po file into a 4.7 site?
If I do need to do an msgmerge, can anyone explain how to do that correctly? i.e. What did I do wrong with the command line above?
Thanks
Try to tame the 'bash'.
You didn't do anything wrong -- command-line-wise. Just tell the 'bash' where to find 'msgmerge' before you execute the command.
The article 'Recycling old translations (http://drupal.org/node/11311)' assumes a Unix/Linux environment. If you are using Mac OS10.4 and Terminal application to enter command lines, your site is most likely to be running on a Unix/Linux environment. And 'bash' is one of the various command line interpreters (or shells) available on Unix/Linux.
'bash' spits out the message
-bash: msgmerge: command not found
when it cannot locate 'msgmerge' in the program search paths. Maybe 'msgmerge' had not been installed. Otherwise you need to modify the search path string - one of the shell environment variables - so that it includes the directory where the 'msgmerge' exists. To find the 'msgmerge' path, type 'whereis msgmerge' on the command line.
Hope this could solve the problem..
still trying to tame bash
Thanks for your explanation and for writing in a way that was easy to understand.
I tried typing whereis msgmerge on the command line and I got an empty prompt line - I'm guessing maybe that means msgmerge has not been installed.
Usually msgmerge is in /usr/bin directory, but not always so..
My Linux system - CentOS - has msgmerge in /usr/bin.
If you have access to another Unix/Linux machine that has msgmerge installed on it,
then you could copy all the .po and .pot files to that system and run the script.