CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Civicrm-menu.po empty ?
Pages: [1]

Author Topic: Civicrm-menu.po empty ?  (Read 6701 times)

long.lethanh

  • Guest
Civicrm-menu.po empty ?
October 02, 2008, 06:14:47 am
Hi everyone,
i decided to help in translation few hours ago. Download .po files from repo and discover that civicrm-menu.po is empty of translations. But menu items are translated. If i add some translations in this file and compile to an .mo, menu items are not translated anymore. Any idea ?
(i hope i had been clear in my explanations).
Thx

Long

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Civicrm-menu.po empty ?
October 02, 2008, 10:24:14 am
Quote from: long.lethanh on October 02, 2008, 06:14:47 am
i decided to help in translation few hours ago. Download .po files from repo and discover that civicrm-menu.po is empty of translations. But menu items are translated.

It would help if you shared which language are we talking about. :)

Quote from: long.lethanh on October 02, 2008, 06:14:47 am
If i add some translations in this file and compile to an .mo, menu items are not translated anymore. Any idea ?

It depends on your compiling process. We have separate PO files, but a common MO file for every language. For every language, I compile all of the PO files into one civicrm.mo like this:

Code: [Select]
msgcat *.po | msgfmt -vo civicrm.mo -
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Civicrm-menu.po empty ?
October 02, 2008, 10:25:05 am
(So, because the strings for translation come from all the files, it’s possible that a given menu entry string is already translated in a different PO file.)
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

long.lethanh

  • Guest
Re: Civicrm-menu.po empty ?
October 02, 2008, 10:46:13 am
Hello,
sorry, language is french and yes i had compiled all the po files with the code you wrote.
The file i download is http://svn.civicrm.org/civicrm/trunk/l10n/fr_FR/LC_MESSAGES/civicrm-menu.po

When i compile my civicrm.mo with this empty po file, i've got translation in french for my menu items.
I begin to fill this empty .po file, no more translation for my menu items, even for translated entries i added in this civicrm-menu.po

I tried to find entries in the others .po files but no success....

May be i did something wrong....

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Civicrm-menu.po empty ?
October 02, 2008, 12:50:30 pm
Hm, this is very strange. I turned on the French language on my 2.1 sandbox, and menu was indeed translated. I recompiled all of the fr_FR PO files into one MO file, and it still worked. I removed the MO file and the install fell back to American English. I replaced the file from pl_PL, and indeed, the menu turned to Polish. I recompiled the French PO files and it all switched back to French properly.

Can you try this case with the PO files form the 2.1 branch? http://svn.civicrm.org/civicrm/branches/v2.1/l10n/fr_FR/LC_MESSAGES/
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

long.lethanh

  • Guest
Re: Civicrm-menu.po empty ?
October 02, 2008, 02:51:25 pm
Ok 'ill try tomorrow.
did u try to modify the Civicrm-menu.po file? and then recompile ?

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Civicrm-menu.po empty ?
October 03, 2008, 12:04:17 am
Yes, I tried – nothing breaks, and the translated strings stay translated.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

long.lethanh

  • Guest
Re: Civicrm-menu.po empty ?
October 03, 2008, 01:48:48 am
Hi again,
- Ok i downloaded po files from http://svn.civicrm.org/civicrm/branches/v2.1/l10n/fr_FR/LC_MESSAGES/
- Compiled into an civicrm.mo
- Uploaded to my server the mo file

- Menu items are translated in french
- I removed the mo files from the fr_fr directory
- no more translation for my menu items - they are all in english
- i recompiled the french po files, menu items came back to normal (in french).

Now the weird part :
- i modify civicrm-menu.po  by adding a traduction for an already translated menu-item: for exemple "civicrm home".
- i compile to an mo file
- upload to server,
- "civicrm home" is not translated anymore, the other items are translated....

The thing that i don't understand is why civicrm-menu.po is empty of translations but strings that appears in this file are translated in website. And i cannot find any existence of those strings in other po files...



Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Civicrm-menu.po empty ?
October 04, 2008, 06:30:20 am
Quote from: long.lethanh on October 03, 2008, 01:48:48 am
- i modify civicrm-menu.po  by adding a traduction for an already translated menu-item: for exemple "civicrm home".
- i compile to an mo file
- upload to server,
- "civicrm home" is not translated anymore, the other items are translated....

This is most likely because this translation conflicts with the translation of "CiviCRM Home" that’s already existing in the civicrm-core.po file.

Quote from: long.lethanh on October 03, 2008, 01:48:48 am
The thing that i don't understand is why civicrm-menu.po is empty of translations but strings that appears in this file are translated in website. And i cannot find any existence of those strings in other po files...

You’ve found out an actual bug in our POT/PO creation process – some of the strings in the civicrm-menu.po file are actually in the other files (like the ‘CiviCRM Menu’ string that’s already in civicrm-core.po). If these strings are translated in both files (like in your case), when you do msgcat *.po, gettext cannot know which translation is the proper one.

In my test civicrm-core.po has

Code: [Select]
msgid "CiviCRM Home"
msgstr "Accueil CiviCRM "

and after adding

Code: [Select]
msgid "CiviCRM Home"
msgstr "Accueil CiviCRM 2"

to civicrm-menu.po, the resulting msgcat PO file ends up with

Code: [Select]
#, fuzzy
msgid "CiviCRM Home"
msgstr ""
"#-#-#-#-#  civicrm-core.po (CiviCRM 2.1)  #-#-#-#-#\n"
"Accueil CiviCRM \n"
"#-#-#-#-#  civicrm-menu.po (CiviCRM 2.1)  #-#-#-#-#\n"
"Accueil CiviCRM 2"

As this translation is marked as ‘fuzzy’, it’s not compiled into the MO file.

I created CRM-3663 to track this issue; I’ll fix it ASAP.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Civicrm-menu.po empty ?
October 04, 2008, 04:38:15 pm
Ok, I think I fixed this issue (and a ton of related ones…). Can you try now, with PO files from the v2.1 branch?
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

long.lethanh

  • Guest
Re: Civicrm-menu.po empty ?
October 08, 2008, 01:05:12 am
Sorry, i was very busy lately. i 've just tested with new files. everything is OK now.
Thanks !!
Just a question : now that i've made hundreds of modifications in buggy po files... how can i merge with those new ones ?
« Last Edit: October 08, 2008, 01:08:24 am by long.lethanh »

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Civicrm-menu.po empty ?
October 08, 2008, 07:51:41 am
You can either read how msgmerge operates, or you can send the buggy files to me and I’ll do the merge for you (but I’ll also take the translations for other CiviCRM users). :)
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Civicrm-menu.po empty ?

This forum was archived on 2017-11-26.