MEpedia:Template translation
This page is intended to keep track of the state of template translation on MEpedia and explain how template translation is accomplished.
Template status
The following tables list the template tags that should be translated. You can find a list of all language codes at MEpedia:Language codes. Where it says that "Foreign languages supported" is "all", it means at least the following 17 language codes: ar, da, de, es, fi, fr, it, ja, nl, no (or nn or nb), pl, pt, ru, sv, vi, zh-hans, zh-hant. (Why these languages? See "Prioritizing languages for translation".)
Most commonly used by editors
Template name | Status | Foreign languages supported | TemplateData foreign languages |
---|---|---|---|
Template:Citation needed | Done | all | TemplateData: all |
Template:Stub | Done | fr, es, de, nl | TemplateData: all |
Template:Cleanup | Translation scheduled | none | TemplateData: all |
Template:Reference pages (Rp) | Done | N/A (only TemplateData needed translation) | TemplateData: fr, es, de, nl |
Template:Reference list (Reflist) | Done | N/A (only TemplateData needed translation) | TemplateData: all |
Other cleanup templates
Template name | Status | Foreign languages supported | TemplateData foreign languages |
---|---|---|---|
Template:Cleanup/Page needed | Translation needed | none | TemplateData: de, es, fr, nl |
Less commonly used by editors
Template name | Status | Foreign languages supported | TemplateData foreign languages |
---|---|---|---|
Template:Mbox | Done | N/A (only TemplateData needed translation) | TemplateData: fr, es, de, nl |
Template:Infobox book | Translation needed? | none | TemplateData: none |
Template:Shortcut (Bookmark) | Done | all | TemplateData: none |
Template:NeedsImage | Done | N/A (only TemplateData needed translation) | TemplateData: fr, es, de, nl |
Template:Disambiguation, uses Dmbox | Done | all | TemplateData: fr, es, de |
Template:Done | Done | all | TemplateData: fr, es, de, nl |
Template:Collapse top, Template:Collapse bottom | Only TemplateData still needs to be translated. | all (Translations are somehow available via class="mw-collapsible" !)
|
TemplateData: none |
Template:Main article | Done | all | TemplateData: none |
Template:See also | Done | all | TemplateData: none |
Template:Dead link | Translation requested | none | TemplateData: de, es, fr |
Citation templates
Template name | Status | Foreign languages supported | TemplateData foreign languages |
---|---|---|---|
Template:Citation | Done | No translation needed | N/A |
CS1 templates (Cite web, Cite news, Cite book, Cite journal, Cite tweet) | Only TemplateData needs to be translated, and only for manual entry in Visual Editor. | N/A | TemplateData: none |
License templates
Template name | Status | Foreign languages supported | TemplateData foreign languages |
---|---|---|---|
Template:Unknown copyright | Translation requested | none | N/A (no TemplateData needed) |
Template:PD | Done | de, es, fr, pt | N/A (no TemplateData needed) |
Template:PD-USGov | Done | de, es, fr, nl | N/A (no TemplateData needed) |
Template:GFDL | Translation requested | none | N/A (no TemplateData needed) |
Template:LGPL | Translation requested | none | N/A (no TemplateData needed) |
Template:FAL | Done | all (specific list?) | N/A (no TemplateData needed) |
Template:CC-zero | Done | all (specific list?) | N/A (no TemplateData needed) |
CC-by-sa-* | Done | all (specific list?) | N/A (no TemplateData needed) |
CC-by-* | Done | all (specific list?) | N/A (no TemplateData needed) |
CC-by-nc-* | Translation requested | none | N/A (no TemplateData needed) |
Template:CC-by-nc-nd-4.0 | Translation requested | none | N/A (no TemplateData needed) |
Template:CC-by-nd-4.0 | Translation requested | none | N/A (no TemplateData needed) |
Template:Fair use license | Translation requested | none | N/A (no TemplateData needed) |
Template:Other license | Translation requested | none | N/A (no TemplateData needed) |
Templates used behind the scenes
Template name | Status | Foreign languages supported | TemplateData foreign languages |
---|---|---|---|
Template:Welcome | Translation requested | none | N/A (no TemplateData needed) |
Template:AllPagesHeaderTemplate | Done | fr, es, de, nl | N/A (no TemplateData needed) |
Template:AllPagesFooterTemplate | Done | fr, es, de, nl | N/A (no TemplateData needed) |
Template:FundraisingSiteNotice | Done | fr, es, de | N/A (no TemplateData needed) |
Template:Protected | Translation requested. Translations should be tested on mediawiki:Protectedpagetext. | none | N/A (no TemplateData needed) |
Other
Template name | Status | Foreign languages supported | TemplateData foreign languages |
---|---|---|---|
Template:Copyright violation | Translation requested | none | N/A (No TemplateData needed.) |
Template:Used with permission | Translation requested | none | N/A (No TemplateData needed.) |
Template:In category | Done | de, es, fi, fr, it, ja, pl, pt, ru, sv, zh-hans, zh-hant | N/A (No TemplateData needed.) |
Template:Heavily used template | Translation requested. | none | N/A (No TemplateData needed.) |
How to translate a template
Using the MediaWiki: namespace for template translations
Small wikis like MEpedia use "Template:" pages that can accommodate any supported language. (There aren't separate "Template:" pages for each language.) Therefore, if there is any user interface message embedded inside the "Template:" page, it should be extracted to a "MediaWiki:" page so the software can translate it as needed. Here is the basic concept of using the MediaWiki: namespace to internationalize a template:
- Move the embedded interface message from the template to a MediaWiki: page, and create translations there. (e.g.
MediaWiki:template-stub-msg1 MediaWiki:template-stub-msg1/fr MediaWiki:template-stub-msg1/de
, etc.) - Inside the template, replace the embedded interface message with the “int:” parser function. For example:
{{int:template-stub-msg1}}
Also note that interface messages in MediaWiki: can accept parameters. For example:
- Assume that the contents of
MediaWiki:template-cleanup-msg1
contains the following:
This article may require cleanup to meet MEpedia's guidelines. The specific reason is: $1 Please help improve this page if you can. ( $2 )
- Inside the template, you can then replace the embedded interface message with:
{{int:template-cleanup-msg1|This page needs references|2019}}
Resources for translation
In many cases, the template won't need to be translated from scratch. Translations can sometimes be adapted from www.TranslateWiki.net Also check Special:AllMessages, as there may already be a pre-translated interface message that can be used. There may be some minor customization needed. If a message needs to be customized, it is better to create a completely new interface message adapted from the pre-existing interface message. It is not a good idea to customize a pre-existing interface message that is used elsewhere, as that may conflict with the original intent of the pre-translated interface message.
Translations without interface messages
The "MediaWiki:" namespace (interface/system message) method, described above, is the preferred way to do template translations, but if no system messages exist, and none can be found in translatewiki.net then they can be created within templates using Template:LangSwitch, which switches between different text depending on the current user's language code. If no translation is provided for the user's preferred reading language, it will default to the English text. (LangSwitch requires that special interface messages be set up for every possible language, such as MediaWiki:lang, MediaWiki:lang/fr, MediaWiki:lang/es, etc.)
Example use: Template:In_category
Text to copy-and-paste:
{{LangSwitch |lang={{{lang|{{int:lang}}}}} |en=English text here |de=German text here |es=Spanish text here |fr=French text here }} <noinclude > {{Documentation}} [[Category:Translated templates]] </noinclude >
Templates that use Modules
Some templates use modules, these are written in Lua and may contain error messages, category names or other text. Translations can be done by using system messages from Lua
- Message library commands - MediaWiki, eg
args.lang = frame:preprocess( "{{int:lang}}")
- Language library commands - MediaWiki
Translating TemplateData for integration into Visual Editor
The "TemplateData" section of a template requires a different method of translating. Certain strings in the TemplateData allow for multiple translations to be specified. The following is an example:
"date": { "label": { "en": "Year", "fr": "Année", "es": "Año", "de": "Jahr" }, "description": { "en": "By default, the current year will be provided. You can specify a different year.", "fr": "Par défaut, l'année en cours sera fournie. Vous pouvez spécifier une autre année.", "es": "Por defecto, se proporcionará el año actual. Puede especificar un año diferente.", "de": "Standardmäßig wird das aktuelle Jahr angegeben. Sie können ein anderes Jahr angeben." }, "example": "2019", "type": "string", "autovalue": "{{subst:CURRENTYEAR}}", "suggested": true }
Bulk creating system messages
If other wikis have system messages with translations you want to use these can be easily exported into a file. This is quicker and less prone to errors than creating them one by one. Wikipedia supports over 400 languages to varying degrees, so each system message may have a very large number of translations. Administrator rights are needed to import them, so it is best if the same person does the export. Places to export translated system messages from include WikiMedia's Commons, MediaWiki, and (English, French, German, etc) Wikipedias may contain some.
- First make a list of messages to export by searching for system messages, eg WikiMedia's Commons search, set to German (de), create a file containing a list of all system messages you want for all possible language codes (eg MediaWiki:donate_interface/aa, MediaWiki:donate_interface/ab), and save on your user area (use the <pre> tag to keep one per line), or just save elsewhere. The easier way to do this is to copy the language codes system messages and replace "lang" with the system message you want to add.
- Make sure each system message has the prefix MediaWiki: and each is on a separate line
- Use Special:Export on the wiki containing the messages, paste a list of the names in the box (one system message per line), pick latest versions only
- Save the file that it creates
- Go to Special:Import on MEpedia to import these, which may take several minutes
- Make a note of any system messages containing errors, the log file in Special:RecentChanges should contain more info
- Bear in mind some system messages are extremely short (2 characters) and will appear on the right of the screen because those languages are written right to left, eg MediaWiki:lang/arc
Translations needed
Templates should have translations for each priority language chosen for MEpedia.