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 can I export po files to civicrm.mo?
Pages: [1]

Author Topic: How can I export po files to civicrm.mo?  (Read 4654 times)

doctorfalken

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
How can I export po files to civicrm.mo?
January 09, 2011, 02:40:19 am
Hello

I've been accepted into the Spanish translation team for CiviCRM. I can edit and add new translations to *. mo of the project, but ...

How I can export my translations into a single file, civicrm.mo?

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 can I export po files to civicrm.mo?
January 09, 2011, 03:45:25 pm
You have a few options to download the .po files:

1- download one at the time (long, hard to automate)
2- use the transifex command line client http://help.transifex.net/user-guide/client/client-0.4.html (I have never tested it, but looks interesting)
3- download from github: https://github.com/civicrm/l10n/tree/3.3/po/es (the translations are committed to github automatically) - this is what I use, since it makes it easier to track what has changed in translations.  i.e. git clone https://github.com/civicrm/l10n.git

Then you have to concatenate the files and compile them:

Code: [Select]
  msgcat *.po | msgfmt -o civicrm.mo -

Then place the resulting civicrm.mo onto your server, in civicrm/l10n/es/civicrm.mo

More information is available in:
http://en.flossmanuals.net/CiviCRM/BasicConcepts (Internationalisation/localisation chapter)

matt
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: How can I export po files to civicrm.mo?
January 10, 2011, 05:22:10 am
Quote from: mlutfy on January 09, 2011, 03:45:25 pm
3- download from github: https://github.com/civicrm/l10n/tree/3.3/po/es (the translations are committed to github automatically) - this is what I use, since it makes it easier to track what has changed in translations.  i.e. git clone https://github.com/civicrm/l10n.git

Note that since the 1.0 transifex.net ‘upgrade’ this is no longer true; they turned off the auto-syncing and I do it manually, at least for now. I’ll try to come up with a better solution, but probably not before end of the month (we have a tight CiviCRM 3.4 release cycle that takes priority now).
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.

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 can I export po files to civicrm.mo?
January 10, 2011, 06:13:15 am
Piotr: how do you pull the files from Transifex before committing them to git? one by one, manually?

(thinking out loud) It would be kind of nice to be able to push to the github/civicrm repository, as a language maintainer. It would facilitate review and "sign-off" of translations, but I guess that, given the number of languages, and the various technical preferences of each team, that would not be a very efficient process. (I guess most of us would forget to review/commit)
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Hans.S

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 5
Re: How can I export po files to civicrm.mo?
January 10, 2011, 12:56:56 pm
I just decompiled the mo, using GETTEXT for Windows, made the changes using a text editor and then recompiled it again and uploaded it to the server.

http://gnuwin32.sourceforge.net/packages/gettext.htm

Just follow the instruction in the /docs folder. Enter the commands using command line in windows.

Easypeasy.  :-*

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 can I export po files to civicrm.mo?
January 10, 2011, 01:05:48 pm
@ Hans: when possible, it is best if you can recontribute those translations to the community. You'll benefit from other people's work, as they will from yours, and will avoid something being done twice. Also, when you upgrade CiviCRM, it will avoid you to merge the translation files.

If you only need to override a few specific strings (or expressions) for something specific to your context, you can use the "word replacement" feature of CiviCRM (Admin -> List options -> Word replacement).
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Hans.S

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 5
Re: How can I export po files to civicrm.mo?
January 11, 2011, 11:19:03 am
Yes indeed there were only a few terms that needed to be changed. I used the "word replacement" to change terms in English but it did not work in the second language, French. Does it work in the secon language?


doctorfalken

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Re: How can I export po files to civicrm.mo?
January 13, 2011, 02:04:24 am
Thank you very much for your help! I´ll try your advices.

thoni56

  • I post occasionally
  • **
  • Posts: 40
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla 3.4.8
Re: How can I export po files to civicrm.mo?
January 26, 2011, 12:58:05 pm
I've set up my environment so that I pull the latest translations from Transifex using their command line client, and will be attempting to msgcat and msgfmt them into an .mo to upload to my site. That way I can really test (my own) translations while still sharing it.

However I can't find a way to only pull a single language from Transifex...

kasiawaka

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 4
    • Kasuwade Solutions Inc.
Re: How can I export po files to civicrm.mo?
March 16, 2011, 01:22:29 pm
I created detailed instructions how to use Poedit, translate .po files and then compile them into one .mo file: http://forum.civicrm.org/index.php/topic,19068.0.html

Kasia
Kasia Wakarecy
http://kasuwade.ca

Armen

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Re: How can I export po files to civicrm.mo?
June 10, 2013, 04:11:04 pm
po to mo

mo to po, mo>po.
Converter_ru
Converter_en

Find your .mo file, right click your mouse on it, see what? ”Convert .mo file to .po file”. Click it and you will see the .po file right away.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • How can I export po files to civicrm.mo?

This forum was archived on 2017-11-26.