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) »
  • Detailed instructions in how to create new translation in Windows
Pages: [1]

Author Topic: Detailed instructions in how to create new translation in Windows  (Read 6542 times)

kasiawaka

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 4
    • Kasuwade Solutions Inc.
Detailed instructions in how to create new translation in Windows
March 16, 2011, 01:19:38 pm
I spend several hours trying to understand the translation process and how I can quickly (without having to join translation team and providing translation online etc.) translate several phrases for French and Spanish that were not yet "officially" translated (the phrases are still in English when viewing pages in FR or ES).
The reason I need to do "offline translation" is that the translation was provided to me by a client and I don't really know if it's a "proper" translation or a customized text that is not good enough for "official" translation.

Here is the procedure that works for me (Windows based):

1. Download (one by one, all 18 of them, what a pain) *.po translation files for your current CiviCRM version from http://www.transifex.net/projects/p/civicrm/

For example, all translations for CiviCRM 3.3 are here: http://www.transifex.net/projects/p/civicrm/r/civicrm-33/:
All *.po files for CiviCRM 3.3 French (fr_FR) are here: http://www.transifex.net/projects/p/civicrm/r/civicrm-33/l/fr/
All *po files for CiviCRM 3.3 Spanish (es_ES) are here: http://www.transifex.net/projects/p/civicrm/r/civicrm-33/l/es/

Note: you will need to create an account for this purpose but it's quick and easy - follow instructions on transifex


2. Download Poedit application (http://sourceforge.net/projects/poedit/) that will help you translate chosen strings. Install it.


3. Now you can double click on each of the .po files, find the string you want to translate and provide the translation. Save the file.


4. Once done adding all the translation strings, copy all .po files (there should be 18 of them) to the bin folder in the location where Poedit was installed.

For example, in Windows standard installation for Poedit would be C:\Program Files\Poedit\bin


5. Open command prompt, navigate to the same location C:\Program Files\Poedit\bin

For those who haven't used Windows command prompt for a while, execute the following 2 commands:
Code: [Select]
cd /
 cd program files/poedit/bin


6. Join all separate .po files into one civicrm.po file by typing in the command prompt:
Code: [Select]
msgcat -o civicrm.po *.po

7. Compile the civicrm.po file into civicrm.mo by typing in the command prompt:
Code: [Select]
msgfmt -o civicrm.mo civicrm.po

8. Copy newly created civicrm.mo file into a proper directory to replace the original file (for example, to replace FR file, copy it to sites/all/modules/civicrm/l10n/fr_FR [Drupal path])


Resources:
  • http://wiki.civicrm.org/confluence/display/CRMDOC33/CiviCRM+Localisation
    http://forum.civicrm.org/index.php/topic,17932
    http://forum.civicrm.org/index.php/topic,2118.0.html
    http://forum.civicrm.org/index.php/topic,10211
    http://forum.civicrm.org/index.php/topic,10298


Annex: For those who wonder how to decompile .mo file into .po file:
Copy .mo file to Poedit bin directory
Using command prompt, navigate to poedit/bin directory and execute:
Code: [Select]
msgunfmt input.mo > output.po
Use Poedit to edit that new .po file.


Good luck
Kasia
Kasia Wakarecy
http://kasuwade.ca

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Detailed instructions in how to create new translation in Windows
March 18, 2011, 08:36:29 am
Hey (and long time no see…), thanks, this is most appreciated!

I’m coming up with a better l10n solution for 3.4.beta1/4.0.beta1 which should show up sometime next week, one that would end the split of POT files per CiviCRM version and simply have one set of PO files covering the most recent versions (3.3-4.0). I’ll update the docs accordingly once it’s in place.
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: Detailed instructions in how to create new translation in Windows
March 18, 2011, 01:20:47 pm
This is not directly related, but as the maintainer for fr and fr_CA, I have been having a bit of a rough time doing QA/review on the contributed translations, so I started using the command line transifex tool.

I wrote a short howto here:
https://wiki.koumbit.net/CiviCrm/Transifex

It is rather helpful to merge and diff files (combined with git).
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

thoni56

  • I post occasionally
  • **
  • Posts: 40
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla 3.4.8
Re: Detailed instructions in how to create new translation in Windows
March 21, 2011, 11:35:31 pm
I'm doing it the other way around, kind of:

- edit in Transifex online
- pull all translations using "tx pull"
- merge into .mo
- install in local site

Doing the three last steps in a Makefile (on Windows a batchfile would work fine) makes it a fairly quick and easy round trip/feedback loop.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Detailed instructions in how to create new translation in Windows
March 29, 2011, 05:40:16 am
As per the latest blog post, I finally managed to come up with a unified (version-agnostic) set of POT/PO files.

The bad news is that you need to adjust your Transifex resources; the good news is that it’s so much simpler to manage now. :)

Do let me know if you have any questions.
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.

MichaS.

  • I’m new here
  • *
  • Posts: 27
  • Karma: 0
  • CiviCRM version: 3.5.5
  • CMS version: Joomla 1.57
  • MySQL version: actual
  • PHP version: 5.x
Re: Detailed instructions in how to create new translation in Windows
April 12, 2011, 06:20:16 am
Dzien dobre Piotr,

its not possible at the moment to update automaticlly the actual langfiles? I translate in Transflex and hope can use nearly by my translations in german

Michael from de_DE

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Detailed instructions in how to create new translation in Windows
May 10, 2011, 06:16:51 am
Quote from: MichaS. on April 12, 2011, 06:20:16 am
its not possible at the moment to update automaticlly the actual langfiles?

Unfortunately not. :| It used to be that Transifex pushed the translations live to the Git repository, in which case it was possible to have a post-commit that would recompile the translations, but currently it’s a manual (once-a-week or on request) process on my end to pull from Transifex and recompile the files.

Tschüß!
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.

reswild

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.6.10
  • CMS version: Drupal
  • MySQL version: 5.5.44
  • PHP version: 5.6.13
Re: Detailed instructions in how to create new translation in Windows
February 05, 2012, 05:01:20 pm
The instructions on the wiki page (wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+Localisation) for compiling translations on Windows is a bit misleading. It tells you to use GetText tools and gives a link to the GetText page at sourceforge.net (gnuwin32.sourceforge.net/packages/gettext.htm). This page, however, will only give you GetText version 0.14.4, and this will not work with the CiviCRM translation files because it doesn't support msgctxt strings.

Poedit for Windows includes a newer version of the GetText tools that will work.

nardanz

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: joomla
  • MySQL version: 5
  • PHP version: 5
Re: Detailed instructions in how to create new translation in Windows
September 22, 2013, 10:52:18 pm
NOTE: Open command prompt as administrator

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Detailed instructions in how to create new translation in Windows

This forum was archived on 2017-11-26.