User:Annabel/Transtool

Transtool is a script written in PHP. It aids in copying of translations between different wiktionaries.

Purpose
Translations are formatted in different ways on different wiktionaries. Therefore, a lot of work is needed before the translations of a word can be copied. Transtool aids in copying translations by converting wikicode between wiktionaries. It can also be used to for converting translations that use ISO 639-1 templates (two letter language codes) to ISO 639-3 templates (three letter language codes).

How does it work?
The tool is written in php. If you use the simple interface, you only need to enter the language for the interface and the language for the wiktionary in which you want to copy the translations.

The advanced interface can be chosen by using the button that contains a blue arrow. It works using a so-called lay-outstring that represents the layout for the result (call it the layout for the section that contains the translations). This string may contain the codes which are translated as:
 * {| border="1" cellpadding="4" cellspacing="0" style="border: 1px solid #aaa; border-collapse: collapse; font-size: 95%; margin:1em 1em 1em 0; background: #fbfbfb;"

! width="100" style="background: #DDEEFF;"|Code ! style="background: #DDEEFF;" | Converted in
 * ln
 * ISO-languagecode: ISO 639-1 code (2 letters) if available, otherwise ISO 639-3 code (3 letters)
 * ln3
 * ISO-languagecode: ISO 639-3 code
 * language
 * full name of the language
 * word
 * translation of a word
 * }
 * word
 * translation of a word
 * }
 * }
 * }

How can I use Transtool?
Transtool can be used by anybody who wishes to reuse the translations of a word in another wiktionary. The following steps describe how to perform such a conversion with minimal effort:


 * Open the article (e.g. chair)
 * Go to the edit link at the top of this article
 * Open in another browser-tab or window the same article but in another wiktionary (e.g. stoel of the Dutch wiktionary)
 * Go to the edit link at the top of this article
 * Copy the wiki-code of the translations from the foreign wiktionary
 * Load the tool's webpage: Transtool and adapt the preferred language if necessary.
 * Paste the copied wiki-code from step 5 in the text-field: Wiki-code to be converted:
 * Push Convert
 * Copy the wiki-code in the text-field Converted wiki-code:
 * Paste it in the article (first tab or window of your browser, see step 2).
 * Please check the translations by using the Show preview button
 * Push the Save page button.

In which languages is Transtool currently available?

 * Interface:
 * There is an interface in English, Dutch and German.
 * Target wiktionaries: '''To which target languages can I use the the tool
 * Currently this is possible for English, German, French, Dutch and Romanian.
 * Source wiktionaries: from which source wiktionaries can I use the translation's wiki-code?'''
 * Currently this is possible for English, French, German, Dutch and Romanian and other wiktionaries that use ISO codes in its translation section, e.g. Kurdish, Russian, Chinese etc. (however, translations are not sorted by language in the latter case)

Can I convert translations from multiple sources simultaneously?

 * Yes, it is possible to use the translations from multiple source wiktionaries. When there are multiple translations into the same language, only the last occurrence is taken account of (see example 2).

'''Example. Conversion from multiple source languages''' *: *:  fr: example m de: Vorbild

Converted wiki-code, suitable for the English wiktionary

*Dutch: voorbeeld *French: example *German: Vorbild

Note: the Wikicode could contain the ISO-language code or name of the language (fully written in English, Dutch, French or German). You may also have to delete the translation into the language of the wiktionary in which the wiki-code will be pasted.

Options
The advanced interface (using the button with the blue arrow), all options of transtool can be changed:
 * Language for the converted wiki-code: language of the wiktionary in which the translations will be added
 * Templates that indicate the beginning, half and end of the translations: depending on the wiktionary, and , ,  and  or $($,  en $)$ is used
 * change m, f and n to templates: m, f, n en o will be converted to, , and
 * remove templates, such as ARCHAR en FARCHAR, around non-western characters: wiki-code for the templates ARchar and FAchar will be removed; this is of importance when these templates are not present in the destination-wiktionary

nl:WikiWoordenboek:Transtool