User:Kephir/gadgets/xte

English edit

Etymology edit

From experimental translator's extension.

Proper noun edit

xte

  1. a script developed by Keφr to assist in working on translations

Usage notes edit

I really mean the experimental part. Features and bugs will appear and disappear at the author's discretion. Install at your own risk. (To do that, visit Wiktionary:Per-browser preferences or put importScript('User:Kephir/gadgets/xte.js'); // [[User:Kephir/gadgets/xte]] into your common.js, on its own line.) Adding the script to your watchlist is a good idea if you do not want to miss anything.

xte recognises names and codes of all languages and scripts encoded into the appropriate modules, like Module:languages. When xte fails to recognise a valid entry, you should probably add the support to {{langrev}}, {{scriptrev}} and such.

Bug reports, feature requests, and other questions are to be answered on Keφr's talk page.

Source code edit
Features edit

The following features are thought to be functioning correctly in most cases and are not considered (yet) for removal:

Fixing translation lists
A a "[fix]" link appears next to "[edit]" at each "Translations" section. After clicking it the script attempts to convert translation lists to use the {{t}} template, attaching gender, transcription and script parameters as appropriate; then it presents the user with a diff which, after reviewing, the user may save. Whole articles can also be processed; just pull down the "xte" menu and select "Fix translations".
Quick code queries
The "Query" menu item brings up a dialog box allowing you to check language name by giving its code and vice versa.
Substitute in edit box
Substitute templates without saving, using a single keypress. Select some markup and press Alt+; (in Chromium) or Alt+Shift+; (in Firefox) to immediately substitute appropriately marked templates. (Also expands four tildes into your signature.)

Features in development:

Partial diff undoing
When viewing a diff, the editor can click the minus signs to restore the previous version of a line. Useful when working with the translation fixer.
Translation fixing edit

You probably got pointed here because xte found a suspicious entry in a page. "Suspicious" probably means one of the following:

Multi-word phrase
When multiple words are linked in a single translation entry, xte assumes the translation is into a sum-of-parts phrase, and wraps the individual words into links if necessary. This assumption might be wrong at times; a translation of an idiomatic multi-word English term into other languages may be likewise an idiomatic multi-word phrase. If this is the case, un-link the individual words.
To judge idiomaticity, try some of the tests linked below:
Inflected word or vocalised spelling
Some entries may link to a different word than they display; most of the time, the displayed label is an inflected form of a word, and the link target is its base. A proper correction will probably depend on context. It should be safe to link to the inflected form; ideally, the target page will point to the base form of the word and/or explain context in which the inflected form is used. However, as of now, most of the time that page simply does not exist and you should not create it if you have little knowledge of the target language.
Some alphabets (like Arabic and Hebrew) do not mark vowels in normal writing; however, putting these marks in a dictionary is obviously beneficial. Latin entries may mark vowel length with macrons; these also do not appear in normal writing. Similarly, a Russian translation entry might want to mark the stressed syllable with a acute accent mark.
In the past, xte would change the link to point to the displayed text. Current behaviour is to put link text into |alt= and preserve the original link. In the latter case, the suggested replacement is most probably fine, but the former might need some attention. Since xte cannot distinguish these two cases, the item is marked for review.
"Chinese"
The language name "Chinese" (zh) is ambiguous and has been deprecated in favour of more precise terms like "Mandarin" (cmn), "Cantonese" (yue), "Min Nan" (nan), etc. However, some entries still contain translations into "Chinese". Most probably these will be into Mandarin (almost surely if they use {{zh-ts}} or {{zh-tsp}}), and xte will convert them to say "Mandarin", but they may need to be checked whether this is actually the case.

If you are unsure what to do, leave the translation entry in the state suggested by xte, or keep the old version. xte automatically attaches {{ttbc}}, adds the language code to edit summary and adds comments to entries it finds suspicious; you might want to do the same when you find anything in need of attention.