... | ... | @@ -146,12 +146,22 @@ The "commit-to-git.sh" script will use the "Last-Translator" |
|
|
|
|
|
# Compiling MO files
|
|
|
|
|
|
<p><strong>Since 2014-04-29, this is done daily (around 9h42 PST) from sushi.c.o (on the "l10n" user account/crontab).</strong> Only languages with more than 20% are added to the official civicrm-l10n.tar.gz file. You need to request to be added <a href="http://forum.civicrm.org/index.php/board,10.0.html" class="external-link" rel="nofollow">(on the forums</a>) once you reach this milestone. The .mo files are available from download.civicrm.org, although not browsable, but you can guess the URL with the fomr:</p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
|
<script type="syntaxhighlighter" class="theme: Confluence; brush: java; gutter: false"><![CDATA[https://download.civicrm.org/civicrm-l10n-core/mo/XX/civicrm.mo
|
|
|
<strong>Since 2014-04-29, this is run daily on a test node via Jenkins.</strong>
|
|
|
|
|
|
... where XX is the language code, such as "es", "fr", etc, and "fr_CA", "es_MX", etc, for regional translations.]]></script>
|
|
|
</div></div><div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/warning.png" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><p>This is a tricky, kludgy and ugly process; it should be fixed by creating a script that uses the xx → xx_YY language mappings found in the <code>xml/templates/languages.tpl</code> file (or the relevant parts of the <code>civicrm_option_value</code> table).</p></td></tr></table></div><p>To recompile MO files run the <code>bin/compile-mo-files.sh</code> script. This will create <code>civicrm.mo</code> files for every language:</p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
|
<script type="syntaxhighlighter" class="theme: Confluence; brush: java; gutter: false"><![CDATA[chastell@devielle:~/CiviCRM/git/l10n$ bin/compile-mo-files.sh
|
|
|
Only languages with more than 20% are added to the official civicrm-l10n.tar.gz file. You need to request to be added <a href="http://forum.civicrm.org/index.php/board,10.0.html" class="external-link" rel="nofollow">(on the forums</a>) once you reach this milestone. The .mo files are available from download.civicrm.org, although not browsable, but you can guess the URL with the form:
|
|
|
|
|
|
```
|
|
|
https://download.civicrm.org/civicrm-l10n-core/mo/XX/civicrm.mo
|
|
|
```
|
|
|
|
|
|
... where XX is the language code, such as 'es_ES', 'fr_FR', 'fr_CA'.
|
|
|
|
|
|
Old historical note: It should be fixed by creating a script that uses the xx → xx_YY language mappings found in the <code>xml/templates/languages.tpl</code> file (or the relevant parts of the <code>civicrm_option_value</code> table).
|
|
|
|
|
|
To recompile MO files run the <code>bin/compile-mo-files.sh</code> script. This will create <code>civicrm.mo</code> files for every language:
|
|
|
|
|
|
```
|
|
|
chastell@devielle:~/CiviCRM/git/l10n$ bin/compile-mo-files.sh
|
|
|
compiling af
|
|
|
compiling ar
|
|
|
…
|
... | ... | @@ -162,6 +172,7 @@ compiling el |
|
|
compiling vi
|
|
|
compiling zh_CN
|
|
|
compiling zh_TW
|
|
|
|
|
|
chastell@devielle:~/CiviCRM/git/l10n$ git status
|
|
|
# On branch master
|
|
|
# Untracked files:
|
... | ... | @@ -177,9 +188,9 @@ chastell@devielle:~/CiviCRM/git/l10n$ git status |
|
|
# po/zh_CN/civicrm.mo
|
|
|
# po/zh_TW/civicrm.mo
|
|
|
nothing added to commit but untracked files present (use "git add" to track)
|
|
|
chastell@devielle:~/CiviCRM/git/l10n$
|
|
|
]]></script>
|
|
|
</div></div><p>The trick is to move the MO files to their relevant places in the Subversion repository (we keep the MO files in the Subversion repository, as it’s linked via <code>svn:externals</code> link from our main repository). Unfortunately, Transifex uses the shortened language names where possible (e.g., <code>pl</code> and <code>hi</code>), using the full <code>xx_YY</code> notation only where necessary (so <code>pt</code> is Portuguese and <code>pt_BR</code> is Brasilian Portuguese), while CiviCRM always uses the full <code>xx_YY} notation (i.e., {{pl_PL</code>, <code>hi_IN</code> and <code>pt_PT</code> for Polish, Hindi and Portuguese, respectively).</p><p>This means that the compiled MO files need to be carefully moved to their relevant subdirectories in the Subversion repository. A crude solution (assuming the Subversion checkout of <a href="http://svn.civicrm.org/l10n" class="external-link" rel="nofollow">http://svn.civicrm.org/l10n</a> is at <code>../../svn/l10n</code>):</p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
|
```
|
|
|
|
|
|
<p>The trick is to move the MO files to their relevant places in the Subversion repository (we keep the MO files in the Subversion repository, as it’s linked via <code>svn:externals</code> link from our main repository). Unfortunately, Transifex uses the shortened language names where possible (e.g., <code>pl</code> and <code>hi</code>), using the full <code>xx_YY</code> notation only where necessary (so <code>pt</code> is Portuguese and <code>pt_BR</code> is Brasilian Portuguese), while CiviCRM always uses the full <code>xx_YY} notation (i.e., {{pl_PL</code>, <code>hi_IN</code> and <code>pt_PT</code> for Polish, Hindi and Portuguese, respectively).</p><p>This means that the compiled MO files need to be carefully moved to their relevant subdirectories in the Subversion repository. A crude solution (assuming the Subversion checkout of <a href="http://svn.civicrm.org/l10n" class="external-link" rel="nofollow">http://svn.civicrm.org/l10n</a> is at <code>../../svn/l10n</code>):</p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
|
<script type="syntaxhighlighter" class="theme: Confluence; brush: java; gutter: false"><![CDATA[# move all xx_YY translations to same-named directories:
|
|
|
for i in po/??_??/civicrm.mo; do mv $i ../../svn/l10n/`echo $i | cut -d/ -f2`; done
|
|
|
|
... | ... | |