[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
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.
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.
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?]