Roxen.git/
local/
translations/
README
Branch:
Tag:
Non-build tags
All tags
No tags
2005-03-22
2005-03-22 19:18:24 by Henrik Grubbström (Grubba) <grubba@grubba.org>
a04334d3e28ec45e4b5f76046ff82adbd90d2934 (
71
lines) (+
71
/-
0
)
[
Show
|
Annotate
]
Branch:
5.2
Documentation about translations for local modules.
Rev: local/translations/README:1.1
1:
+
Translations for locally installed modules.
-
+
HOWTO:
+
+
1) In your module file add the following code after the #include
+
of <module.h>:
+
+
//<locale-token project="myproject">LOCALE</locale-token>
+
//<locale-token project="myproject">DLOCALE</locale-token>
+
#define LOCALE(X,Y) _STR_LOCALE("myproject",X,Y)
+
#define DLOCALE(X,Y) _DEF_LOCALE("myproject",X,Y)
+
+
After the above definitions, you can use
+
+
LOCALE(0, "String to localize")
+
+
for strings that must be immediately translated, and
+
+
DLOCALE(0, "String to localize")
+
+
for strings that may have deferred translation (eg
+
variable documentation).
+
+
2) Add the following lines to the beginning of create() in your
+
module:
+
+
Locale.register_project("myproject",
+
combine_path(__FILE__,
+
"../../translations/%L/myproject.xml"));
+
+
Note: You need to specify the correct number of ../ to get
+
to the translations directory.
+
+
3) Create a project description xml file in the configs directory
+
specifying the files that are part of your module:
+
+
<?xml version="1.0" encoding="iso-8859-1"?>
+
+
<project name="myproject">
+
<nocopy />
+
<baselang>eng</baselang>
+
<xmlpath>../local/translations/%L/myproject.xml</xmlpath>
+
<file>../local/modules/myproject.pike</file>
+
</project>
+
+
Note: The file names are specified relative to the server
+
directory.
+
+
Note: The path specified in <xmlpath> must correspond to the one
+
in register_project() above in step 2.
+
+
Note: The directory for the language specified in <baselang> must
+
exist before the next step.
+
+
4) Now you can actually generate the translation template files:
+
+
make
+
+
5) To make an initial translation, copy the translation template file
+
eng/myproject.xml to the appropriate language catalog.
+
+
mkdir ger
+
cp eng/myproject.xml ger
+
+
Note: Language catalogs are named according to ISO 639-2/T. To get
+
a list valid of ISO 639-2/T codes you can execute:
+
+
../../start --silent-start --program \
+
-e 'write("%O", Standards.ISO639_2.list_languages_t());'
+
+
$Id: README,v 1.1 2005/03/22 19:18:24 grubba Exp $
Newline at end of file added.