Commit 047d22fa5534d40f2d19c8da622c4e80f704d2a8
1 parent
7eb589da
Updated .po generation procedure
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4671 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
5 additions
and
19 deletions
docs/developer/i18n.txt
| ... | ... | @@ -10,25 +10,11 @@ internationalisation. |
| 10 | 10 | Testing |
| 11 | 11 | ------- |
| 12 | 12 | - install gettext command line utilities |
| 13 | +- Run the following to extract translatable text from the templates: | |
| 14 | + $ rm -f i18n/templates.c | |
| 15 | + $ php bin/smarty_to_gettext.php . > i18n/templates.c | |
| 13 | 16 | - run xgettext to generate .po files eg. |
| 14 | -Neil quite likes: | |
| 15 | - $ find . -type f | xgettext --no-wrap -d knowledgeTree -L PHP -s -f - -o i18n/knowledgeTree.po | |
| 16 | - | |
| 17 | -Michael was using: | |
| 18 | - xgettext --files-from=i18n/file-list -LPHP --keyword=_ --no-wrap --msgid-bugs-address="kt-i18n@jamwarehouse.com" -o knowledgeTree.po | |
| 19 | - | |
| 20 | -- write a test translation by editing the po file appropriately. if you have problems with the order of parameters, because your language's | |
| 21 | - ordering is different then in english. You can use the $ to change order eg: | |
| 22 | - msgid "Upgrading item %d of %d" | |
| 23 | - msgstr "... %2$d ... %1$d ..." | |
| 24 | -- construct the right directory structure inside i18n eg. | |
| 25 | - $ mkdir -p i18n/es/LC_MESSAGES/ | |
| 26 | -- upgrade the existing .po files in each translation using: | |
| 27 | - $ mv knowledgeTree.po old.po | |
| 28 | - $ msgmerge --no-wrap old.po ../knowledgeTree.po --output-file=knowledgeTree.po | |
| 29 | - $ rm old.po | |
| 30 | -- use msgfmt to compile your translated .po file to a .mo | |
| 31 | - $ msgfmt --check $knowldgeTree.po --output-file=i18n/$es/LC_MESSAGES/knowledgeTree.mo | |
| 32 | -- change $default->defaultLanguage in config/environment.php and verify your translation. | |
| 17 | + $ find . -type f -name "*.php" -o -name "*.inc" | xgettext --no-wrap -d knowledgeTree -L PHP -s -f - -o i18n/knowledgeTree.po | |
| 18 | + $ echo i18n/templates.c | xgettext --no-wrap -d knowledgeTree -j -s -f - -o i18n/knowledgeTree.po | |
| 33 | 19 | |
| 34 | 20 | $Id$ | ... | ... |