forked from mozilla/betafarm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving compile-mo into bin and integrating locale/README into docs
- Loading branch information
Showing
4 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# syntax: | ||
# compile-mo.sh locale-dir/ | ||
|
||
function usage() { | ||
echo "syntax:" | ||
echo "compile.sh locale-dir/" | ||
exit 1 | ||
} | ||
|
||
# check if file and dir are there | ||
if [[ ($# -ne 1) || (! -d "$1") ]]; then usage; fi | ||
|
||
for lang in `find $1 -type f -name "*.po"`; do | ||
dir=`dirname $lang` | ||
stem=`basename $lang .po` | ||
msgfmt -o ${dir}/${stem}.mo $lang | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ Contents | |
gettingstarted | ||
libs | ||
l10n_setup | ||
l10n_update | ||
|
||
|
||
Indices and tables | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
L10n Update | ||
=========== | ||
|
||
Follow these steps to update strings for L10n. | ||
|
||
We are using English strings for gettext message ids. | ||
|
||
Environment Setup | ||
----------------- | ||
|
||
Your top level directory named locale should be an SVN repository. | ||
This is because we will generate files there and we'll | ||
commit via SVN. Developers who never deal with L10n | ||
do not need to worry about this kind of setup. It's often | ||
easier to have a L10n dev setup, which a cron job updates | ||
the sources, updates the strings, and compiles the po | ||
files and lastly commiting to SVN. | ||
|
||
Instructions: | ||
------------- | ||
|
||
1. ``./manage.py extract `` | ||
2. ``./manage.py verbatimize --rename`` | ||
This will copy the POT files created in step 1 to templates/LC_MESSAGES | ||
3. ``./manage.py merge`` | ||
|
||
Optional: | ||
--------- | ||
|
||
4. ``locale/compile-mo.sh locale`` | ||
|
||
New Locales: | ||
------------ | ||
|
||
Assuming you want to add 'fr': | ||
|
||
#. ``mkdir -p locale/fr/LC_MESSAGES`` | ||
#. ``./manage.py merge`` | ||
|
||
or | ||
|
||
#. ``msginit --no-translator -l fr -i templates/LC_MESSAGES/messages.pot -o fr/LC_MESSAGES/messages.po`` | ||
#. repeat for other POT files |