Mercurial > pyntnclick
comparison README-i18n.txt @ 479:4ea237bbcef8 1.0.1
Tidy up the i18n changes
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Tue, 08 Mar 2011 13:25:20 +0200 |
parents | a9925aaf5f61 |
children | eafa66caedd2 |
comparison
equal
deleted
inserted
replaced
478:a9925aaf5f61 | 479:4ea237bbcef8 |
---|---|
15 | 15 |
16 If there is no file for your locale you need to generate it. To do | 16 If there is no file for your locale you need to generate it. To do |
17 this navigate to the `po/' directory in terminal and type command | 17 this navigate to the `po/' directory in terminal and type command |
18 | 18 |
19 msginit -l <locale> | 19 msginit -l <locale> |
20 | 20 |
21 where <locale> is two-letters-language-code you need. Then translate | 21 where <locale> is two-letters-language-code you need. Then translate |
22 generated file using your preferred editor. | 22 generated file using your preferred editor. |
23 | 23 |
24 To get new translation worked you need to compile and install it by | 24 To get new translation to work you need to compile and install it by |
25 executing `install-po.sh' script. | 25 executing `install-po.sh' script. |
26 | 26 |
27 | 27 |
28 == How can I mark the string in code as translatable? == | 28 == How can I mark the string in code as translatable? == |
29 | 29 |
30 Just surround it with _( and ) like | 30 Just surround it with _( and ) like |
31 "Hello, world" -> _("Hello, world!") | 31 "Hello, world" -> _("Hello, world!") |
32 | 32 |
33 _() is a function that I placed in `gamelib/i18n.py' file, so you | 33 _() is a function in `gamelib/i18n.py' file, so you might want to |
34 might want to import it first. | 34 import it first. |
35 | 35 |
36 from gamelib.i18n import _ | 36 from gamelib.i18n import _ |
37 | 37 |
38 And don't forget to update message catalogs with new strings. To do | 38 And don't forget to update message catalogs with new strings. To do |
39 that just execute `update-po.sh' script. It collects all translatable | 39 that just execute `update-po.sh' script. It collects all translatable |
40 strings from files that are specified in `po/POTFILES'. Make sure file | 40 strings from files that are specified in `po/POTFILES'. Make sure the |
41 you worked on is in there. | 41 file you worked on is in there. |
42 |