User:Annabel/Transtool

From Wiktionary, the free dictionary
Jump to navigation Jump to search

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

Purpose[edit]

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

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:

Code 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

How can I use Transtool?[edit]

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:

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


In which languages is Transtool currently available?[edit]

  • 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?[edit]

  • 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

 *{{nl}}: {{trad|nl|voorbeeld}}
 *{{fr}}: {{trad|nl|example}}
 fr: [[example]] ''m''
 de: [[Vorbild]]
 

Converted wiki-code, suitable for the English wiktionary

 {{trans-top|}}
 *Dutch: {{t|nl|voorbeeld}}
 *French: {{t|fr|example|m}}
 {{trans-mid}}
 *German: {{t|de|Vorbild}}
 {{trans-bottom}}
 

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[edit]

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 {{trans-top}}, {{trans-mid}} and {{trans-bottom}}, {{top}}, {{mid}} and {{bottom}} or {{(}}, {{-}} en {{)}} is used
  • change m, f and n to templates: ''m'', ''f'', ''n'' en ''o'' will be converted to {{m}}, {{f}}, {{n}} and {{n}}
  • 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