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) »
  • How to Compile po files into mo file to update production site language?
Pages: [1]

Author Topic: How to Compile po files into mo file to update production site language?  (Read 3480 times)

Luciano S.

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
  • iXiam Team Leader
  • CiviCRM version: 4.2+ / 4.3+ / 4.4+
  • CMS version: Drupal
  • MySQL version: 5.1+ / 5.5+
  • PHP version: 5.3+ / 5.4+
How to Compile po files into mo file to update production site language?
January 31, 2012, 08:08:52 am
Hi,

We want to update the language of a civicrm production site with the latest Transfix translation (our team was working in the es_MX translations lately).
I downloaded the git repository for CiviCRM translations and it is not updated with the changes we made, so I followed this wiki page:

http://wiki.civicrm.org/confluence/display/CRMDOC40/Transifex+howto

Installed the Transfix tools, then downlaoded the latest version of Transfix repository for es_MX, and the next step is to compile the po files into one civicrm.mo file, but the topic "Compiling the files in order to update the translation file on a production environment" says nothing about how to do it.

There is another wiki page "Localisation stack" but it's not really clear how to proceed, which sh script I need to run, etc..

Anyone knows how I move on the next step, and what to do?
Would be nice to have that step described in the wiki page

Thanks for any help!
cheers




Luciano S.

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
  • iXiam Team Leader
  • CiviCRM version: 4.2+ / 4.3+ / 4.4+
  • CMS version: Drupal
  • MySQL version: 5.1+ / 5.5+
  • PHP version: 5.3+ / 5.4+
Re: How to Compile po files into mo file to update production site language?
January 31, 2012, 09:29:56 am
Ok, I think I've done it..

after downloading the Transifex repository (all of them "tx pull -a" or just one language "tx pull -l es_MX"), you will have this folder / files structure:

Code: [Select]
civicrm.admin
es_MX.po
civicrm.campaign
es_MX.po
civicrm.case
es_MX.po
civicrm.common-base
es_MX.po
civicrm.common-components
es_MX.po
civicrm.contribute
es_MX.po
. . . .
etc

so manually (or maybe there is a script around there, I haven't checked out for it) you have to rename all the *.po files according its container folder before compiling:

Code: [Select]
es_MX
admin.po
campaign.po
case.po
common-base.po
common-components.po
contribute.po
. . . .
etc

the run msgcat --use-first es_MX/*.po | msgfmt -o es_MX/civicrm.mo -
it will create the civicrm.mo file that can be copied to the l10n/es_MX folder in your production site to update the civicrm language.

If anyone has a better (and easier :) ) way to do it, bring it on!!

cheers

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: How to Compile po files into mo file to update production site language?
January 31, 2012, 12:10:38 pm
That sounds like the best way to do it.

We also have a git mirror of the .po files, so that people don't need to install the "tx" command line client, but the files there are not synched very regularly (I kind of inherited this task recently, and still in the process of getting used to it).
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • How to Compile po files into mo file to update production site language?

This forum was archived on 2017-11-26.