... | ... | @@ -52,37 +52,44 @@ The "po" files use a different file hierarchy than the default Transif |
|
|
|
|
|
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.
|
|
|
|
|
|
# Refreshing POT files
|
|
|
|
|
|
The .pot files are the source translation files that will be sent to Transifex for translation. They contain the source US-English strings.
|
|
|
# Supported CiviCRM versions
|
|
|
|
|
|
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.
|
|
|
* Latest RC
|
|
|
* Latest ESR
|
|
|
|
|
|
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).
|
|
|
# Refreshing POT files
|
|
|
|
|
|
For example:
|
|
|
The .pot files are the source translation files that will be sent to Transifex for translation. They contain the source US-English strings.
|
|
|
|
|
|
```
|
|
|
mkdir ~/tmp
|
|
|
export TMPDIR=~/tmp
|
|
|
```
|
|
|
We should regenerate the .pot files when a new release branch is created (ex: 5.14) when the new release goes RC (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.
|
|
|
|
|
|
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
|
|
|
./bin/build-unified-pots.sh ~/repositories/civicrm po/pot "5.21 5.22" 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).
|
|
|
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
|
|
|
./bin/build-unified-pots.sh ~/repositories/civicrm po/pot "5.21 5.22 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>
|
|
|
|
|
|
## If the /tmp partition is too small
|
|
|
|
|
|
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
|
|
|
```
|
|
|
|
|
|
## Review new translation strings
|
|
|
|
|
|
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.
|
... | ... | |