... | ... | @@ -50,32 +50,49 @@ The l10n repository contains: |
|
|
|
|
|
<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>The "po" files use a different file hierarchy than the default Transifex one.</p>
|
|
|
|
|
|
<p>With Transifex, files are structured in the form of "civicrm.<component>/<lang>.po". In the l10n git repository, we use the structure "<lang>/<component>.po". It makes it easier to extract and compile only part of the translation. The magic for making this happen is in the file: l10n/.tx/config.</p></td></tr></table></div><h1 id="PushingnewstringstoTransifex-RefreshingPOTfiles">Refreshing POT files</h1><p>The "POT" files are the source translation files that will be sent to Transifex for translation. They contain the source US-English strings.</p><p>We need to regenerate the POT files when a new release branch is created (ex: v4.2) when the new release goes beta (to allow translators a bit of time to translate before the official release). If we do not refresh the files, translators will not be able to find the string in Transifex.</p>
|
|
|
With Transifex, files are structured in the form of "civicrm.<component>/<lang>.po". In the l10n git repository, we use the structure "<lang>/<component>.po". It makes it easier to extract and compile only part of the translation. The magic for making this happen is in the file: l10n/.tx/config.
|
|
|
|
|
|
<h2 id="PushingnewstringstoTransifex-GeneratingnewPOTfiles">Generating new POT files</h2>
|
|
|
# Refreshing POT files
|
|
|
|
|
|
<p>NOTE: the extraction creates a lot of temporary files in /tmp. If you do not have enough space in that directory, you can set the TMPDIR environment variable to use another directory (before running the build-unified-pots.sh script).</p>
|
|
|
The .pot files are the source translation files that will be sent to Transifex for translation. They contain the source US-English strings.
|
|
|
|
|
|
<p>For example:</p>
|
|
|
We need to regenerate the .pot files when a new release branch is created (ex: 5.14) when the new release goes beta (to allow translators a bit of time to translate before the official release). If we do not refresh the files, translators will not be able to find the string in Transifex.
|
|
|
|
|
|
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
|
<script type="syntaxhighlighter" class="theme: Confluence; brush: java; gutter: false"><![CDATA[mkdir ~/tmp
|
|
|
export TMPDIR=~/tmp]]></script>
|
|
|
</div></div><p>To run the extraction process, run:</p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
|
<script type="syntaxhighlighter" class="theme: Confluence; brush: java; gutter: false"><![CDATA[./bin/build-unified-pots.sh ~/repositories/civicrm po/pot '4.2 4.3 4.4 4.5' 2>&1 | tee pots.log]]></script>
|
|
|
</div></div><p>You can also run the script on the "master" branch, but this is not recommended unless we are in beta:</p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
|
<script type="syntaxhighlighter" class="theme: Confluence; brush: java; gutter: false"><![CDATA[./bin/build-unified-pots.sh ~/repositories/civicrm po/pot '4.2 4.3 4.4 master' 2>&1 | tee pots.log
|
|
|
]]></script>
|
|
|
</div></div>
|
|
|
NOTE: the extraction creates a lot of temporary files in /tmp. If you do not have enough space in that directory, you can set the TMPDIR environment variable to use another directory (before running the build-unified-pots.sh script).
|
|
|
|
|
|
For example:
|
|
|
|
|
|
```
|
|
|
mkdir ~/tmp
|
|
|
export TMPDIR=~/tmp
|
|
|
```
|
|
|
|
|
|
To run the extraction process, run:
|
|
|
|
|
|
```
|
|
|
./bin/build-unified-pots.sh ~/repositories/civicrm po/pot "5.14 5.13 5.7" 2>&1 | tee pots.log
|
|
|
```
|
|
|
|
|
|
You can also run the script on the "master" branch, but this is not recommended except for testing (branches get created for when a version goes to RC, so you can also use that).
|
|
|
|
|
|
```
|
|
|
./bin/build-unified-pots.sh ~/repositories/civicrm po/pot "5.14 5.13 5.7 master 2>&1 | tee pots.log
|
|
|
```
|
|
|
|
|
|
Note that the releases to be covered are all provided as one, quoted, space-separated string. This will (a) make fresh copies of the relevant releases in your temp directory, (b) bootstrap them with minimal config, (c) run GenCode to create all of the DAO files and (d) create the given release’s POT files, afterwards (e) combining the per-release POT files into release-agnostic POT files and (f) putting them in <code>po/pot</code>.
|
|
|
|
|
|
<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>Gettext will emit a warning if it detects an incorrect use of the ts() function. For example, ts("Created $foo") is a common mistake. It should be written as ts("Created !1", array(1 => $foo)). For more information, see the <a href="/confluence/display/CRMDOC/Internationalisation+for+Developers">Internationalisation for Developers</a>. If you find a mistake, correct it in the CiviCRM code, commit, then re-run the script.</p></td></tr></table></div>
|
|
|
|
|
|
## Review new translation strings
|
|
|
|
|
|
<p>Note that the releases to be covered are all provided as one, quoted, space-separated string. This will (a) make fresh copies of the relevant releases in your temp directory, (b) bootstrap them with minimal config, (c) run GenCode to create all of the DAO files and (d) create the given release’s POT files, afterwards (e) combining the per-release POT files into release-agnostic POT files and (f) putting them in <code>po/pot</code>.</p><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>Gettext will emit a warning if it detects an incorrect use of the ts() function. For example, ts("Created $foo") is a common mistake. It should be written as ts("Created !1", array(1 => $foo)). For more information, see the <a href="/confluence/display/CRMDOC/Internationalisation+for+Developers">Internationalisation for Developers</a>. If you find a mistake, correct it in the CiviCRM code, commit, then re-run the script.</p></td></tr></table></div><h2 id="PushingnewstringstoTransifex-Reviewnewtranslationstrings">Review new translation strings</h2><p>It's worth taking the time to review the new strings which have been added to CiviCRM to fix any spelling/grammar/typos mistakes in the original English strings.</p>
|
|
|
It's worth taking the time to review the new strings which have been added to CiviCRM to fix any spelling/grammar/typos mistakes in the original English strings.
|
|
|
|
|
|
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
|
<script type="syntaxhighlighter" class="theme: Confluence; brush: java; gutter: false"><![CDATA[git status
|
|
|
git diff --patience po/pot/*.pot | ./bin/diff-check.php]]></script>
|
|
|
</div></div>
|
|
|
|
|
|
<p>In any files were added (and are still "untracked" by git), you can add them to the git repository:</p>
|
|
|
In any files were added (and are still "untracked" by git), you can add them to the git repository:
|
|
|
|
|
|
```
|
|
|
git add po/pot/something.pot
|
... | ... | |