annotate README-i18n.txt @ 854:3577c51029f1 default tip

Remove Suspended Sentence. pyntnclick is the library we extracted from it
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 21 Jun 2014 22:15:54 +0200
parents eafa66caedd2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
478
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
1 These are notes on internationalization and translation. They are
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
2 suitable for Unix like systems. As prerequisites you need `gettext'
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
3 being installed and (if you want to translate) some editor for
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
4 gettext catalogs like `poedit' or `virtaal'. In case you are familiar
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
5 with gettext ".po" format any text editor will do.
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
6
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
7
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
8 == How can I mark the string in code as translatable? ==
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
9
783
eafa66caedd2 Fix trailing space and old reference to gamelib.i18n.
Simon Cross <hodgestar@gmail.com>
parents: 479
diff changeset
10 Just surround it with _( and ) like
478
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
11 "Hello, world" -> _("Hello, world!")
479
4ea237bbcef8 Tidy up the i18n changes
Stefano Rivera <stefano@rivera.za.net>
parents: 478
diff changeset
12
4ea237bbcef8 Tidy up the i18n changes
Stefano Rivera <stefano@rivera.za.net>
parents: 478
diff changeset
13 _() is a function in `gamelib/i18n.py' file, so you might want to
4ea237bbcef8 Tidy up the i18n changes
Stefano Rivera <stefano@rivera.za.net>
parents: 478
diff changeset
14 import it first.
478
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
15
783
eafa66caedd2 Fix trailing space and old reference to gamelib.i18n.
Simon Cross <hodgestar@gmail.com>
parents: 479
diff changeset
16 from pyntnclick.i18n import _
478
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
17
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
18 And don't forget to update message catalogs with new strings. To do
a9925aaf5f61 i18n and Russian translation
Stefano Rivera <stefano@rivera.za.net>
parents:
diff changeset
19 that just execute `update-po.sh' script. It collects all translatable
479
4ea237bbcef8 Tidy up the i18n changes
Stefano Rivera <stefano@rivera.za.net>
parents: 478
diff changeset
20 strings from files that are specified in `po/POTFILES'. Make sure the
4ea237bbcef8 Tidy up the i18n changes
Stefano Rivera <stefano@rivera.za.net>
parents: 478
diff changeset
21 file you worked on is in there.