[Home]UseModWiki/Translations

UseModWiki | UseModWiki | RecentChanges | Preferences

UseModWiki supports non-English interfaces using a translation table. All the normal user-interface messages are translated, along with nearly all error messages. (Some of the admin-only functions are not currently translated.) The translated strings are extracted using the umtrans.pl program in the misc/ directory of the wiki distribution.


Using a translation file:

[At this time (September 15, 2003) there are no downloadable translation files. I hope to make a collection of translations in the next few weeks and make them available on usemod.com. For now, you can cut/paste translations from the wiki pages below.]

Suppose you have a translation file called "esperanto.pl", and wish to use that language for your wiki. Here is the procedure:

1. Place the esperanto.pl file in a location where the wiki script can read it. (The $DataDir directory is a good place.) Make sure the permissions are correct so that it can be read by the script. (The command "chmod ugo+r esperanto.pl" should work.)

2. In your config file (or the script after the configuration settings) add a line like:

do "/home/me/wiki/esperanto.pl";
...using the full path to the translation file. If you placed it under $DataDir then that line would look like
do "$DataDir/esperanto.pl";

The wiki will then read in and use the translation table for all requests. If you have a very busy wiki, you may want to copy the full contents of your translation file into the configuration file (or the script itself). (On the other hand, if your wiki is that busy, you may want to use some kind of PersistentCGI system.)

Optional step 3: For some character sets you may need to set $HttpCharset to make the browser display characters properly. (For example, one Polish wiki uses $HttpCharset = 'iso-8859-2'; for proper display of some characters.)

There is also $NonEnglish? variable in config file. By default it is 0 and only A-Za-z characters are allowed in link names. To use other letters like ń÷ňŘ─Í┼▄ in link names, set this varible to value 1.


Translation files
Creating translation files:

To create a translation file for a new language, copy the trans.pl file (in the misc/ directory) and edit it. The file contents look like:

%Translate = split('\n',<<END_OF_TRANSLATION);
Could not create %s

Showing revision %s

Revision %s not available

showing current revision instead

Updates since %s

[...many lines deleted...]
Missing page id to lock/unlock...

Lock for %s created.

Lock for %s removed.

END_OF_TRANSLATION

Next, edit the file, and add your translations on the line below the English version. For example (in spanish):

# This is Translation file version <version> source: <URL>
%Translate = split('\n',<<END_OF_TRANSLATION);
Could not create %s
No se pudo crear %s
Showing revision %s
Mostrando revisiˇn %s
Revision %s not available
Revisiˇn %s no disponible

The "%s" text in some of the translations marks the place where text will be inserted. This allows more flexible translations, especially in languages with different word orders than English. For example, here is a silly English->English translation entry:

Revision %s not available
The availability of revision %s is negative.
You do not have to provide translations for all of the strings--any messages that do not have translations will use the English version. (You might not care about translating all of the error messages.)

In the 1.0 release a new translation feature was added to allow multiple insertions within sentences, which may be reordered in the translation. This uses %1, %2, %3, etc (up to %9) to indicate the first, second, third, etc texts to be inserted. Here is another silly example:

Difference (from revision %1 to %2)
The new revision %2 is different from the old revision %1 with the following changes:
This new feature (using the Tss() function) is only used in one place in 1.0, but it may be useful for people writing new code.


Updating translation files:

After code changes (or a new release), it is possible to update a translation file to include new text from the code. You can use the umtrans.pl script like this:

umtrans.pl wiki.pl oldtrans.pl > newtrans.pl

...where oldtrans.pl is your old translation file.

[More instructions to follow later?]


Great stuff, Cliff. I'll turn the translation file into a wiki page for the community to work on, pull it down for use when everything's validated. I can run a 'diff' on my current English vs Esperanto versions for a jump start. -- JerryMuelver


Send any questions or suggestions to mailto:usemod@usemod.com. Contributions of finished translation files would also be greatly appreciated.

UseModWiki | UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited February 18, 2015 6:50 pm by 86.84.238.8 (diff)
Search: