A.2 Adding new strings written to document
If you need to write strings, for example the new string a string
to the resulting document, call &$I('a string'). Use simple quotes.
If you want to substitute a value in the string put
%{string_value}, in the string, and give a second argument
to &$I, a hash reference with key string_value and value
the what you want to substitute.
Here is an example:
| | return &$I('%{name} of %{class}',
{ 'name' => $name, 'class' => $class });
|
In that case %{name} is substituted by $name in the translated
string.
After that you should run the command ./manage_i18n.pl in the top
directory, to add your new strings to the template file, that is the
file for english and to all the files in the ‘i18n’
directory. This is achieved with
| | ./manage_i18n.pl template
./manage_i18n.pl update
|
These two commands won't work if you don't have the
Data::Dumper module installed.
And to merge the new translation files in ‘translations.pl’, do
All these steps may be performed by make, once the language file
is added to ‘Makefile.am’ in the i18n_files variable.
Doku-Base
This document was created by Netzdino using texi2html.
|