Content found in this wiki may not reflect official Church information. See Terms of Use for more information.

TechWiki:Translation

From TechWiki
Jump to navigationJump to search

Translation of Tech Wiki articles should follow this process to provide a consistent experience for wiki users who speak languages other than English. Automated translation is available on every page using the "Translate" button in the sidebar, or using native browser capabilities.

Overview

Translated pages are stored as subpages, using the ISO 639-1 two-letter language code. The English language version of a page is the translation source, and does not use an "en" subpage. For example, the translation of this page "Translation" into Spanish (ISO 639-1 code is "es") would be titled "Translation/es"; the German translation would be titled "Translation/de". Templates facilitate the linking between the various translations of a page.

For convenience, the two-letter language codes of common languages are as follows:

  • German: de
  • Spanish: es
  • French: fr
  • Italian: it
  • Japanese: ja
  • Korean: ko
  • Portuguese: pt
  • Russian: ru
  • Chinese: zh

The languages mentioned here are referred to by the Translation Department as the "Internet 10." Projects on the Internet are often translated into these ten languages.

For other language codes, please see the ISO 639-1 codes Wikipedia article. Note that the 2 letter codes are listed in the 639-1 column of the table on this page.

Templates

There are two common templates and one collection of templates (one per base English page that has been translated):

  • {{Other languages}}: This template does the main work of displaying a globe icon and the phrase "In other languages" (in the language of the current page), followed by links to all the languages that the current page is translated into. This template is not used directly in articles, but rather is used within the page-specific templates.
  • {{Other languages/link}}: This is a helper template that simply displays an individual language link.
  • Page-specific templates: For each translated page, a template called "Template:Other languages/<page name>" is created. It simply transcludes the {{Other languages}} template, and has multiple parameters that specify the current translations, as well as a single "page" parameter that specifies the page name. For example, the page-spacific template for this page would be called "Template:Other languages/Translation" and if it were translated into Spanish and Portuguese, its content would be {{Other languages|es|pt|page=Translation}}.

Links

An additional template is provided for wikilinks within translated pages. A base English page will typically contain links to several other articles. For many (or perhaps all) of these links, the linked article will not currently be translated. However, a linked article may well be translated at some point in the future, and it is desirable to have that link go to the translated article when it becomes available.

The {{langlink}} template addresses these issues. It should be used in place of all wikilinks within a translated page. For example, without this template, the Spanish Stake technology specialist/es page would have to choose to link directly to a "Impresora" page (which may not exist) by using the [[impresora]] syntax, or link to the English article by using the [[Printing|impresora]] syntax. But instead, the {{langlink|Printing|impresora}} syntax will link to the Spanish version of the Printing page if it exists, and otherwise to the English version.

Procedure for translating pages

To translate a page on the wiki, you must create an Other languages template for each page you are translating (but not each language). You then embed the Other languages template onto each page. The steps that follow will use the example of translating a page titled "Pagename"; substitute your article name for "Pagename" when you follow this procedure. Note that titles are case sensitive.

To translate an article into a new language, follow these steps.

  1. If the base English page already includes a page-specific {{Other languages}} template, jump to the next section Add an additional language.
  2. Create a new template called "Template:Other languages/Pagename" with only one line of content: {{Other languages|en|es|page=Pagename}}.
    • The list of language parameters will always include English ("en") and the language codes for all other languages for which you are adding translated content at this time.
  3. Edit the base English page
  4. Insert at the very top of the page: {{Other languages/Pagename}}
  5. Save the page.
  6. Proceed to create the new page with translated content as described below under Create the new page. Repeat this step if you are adding translated versions of this page for more than one language.

Add an additional language

If the base English page has already been translated into at least one language, then to add an additional translation, simply:

  1. Edit the {{Other languages/Children}} template to contain one more parameter for the new language (there is a convenient "[edit]" link displayed as part of the template). For example, if you are adding a German translation, you would insert "|de" immediately after "Other languages" in {{Other languages|en|es|pt|page=Children}} to produce {{Other languages|de|en|es|pt|page=Children}}.
    • The language code parameters should always be sorted alphabetically by language code; this will provide consistency in the ordering of all translated pages across the wiki.
  2. Go to the base English page "Children," which will now include the new language link. In the above example, you would see "Deutsch" (German) appear in the "In other languages" links at the top of the page.

Create the new page

  1. Find the "In other languages" links at the top of the base English page.
  2. Click the language link that corresponds to the language of the translation you are adding, and you will be in Edit mode for a new page titled "Pagename/es".
  3. Translate the page (following the Formatting guidelines below).
  4. Save.

Format the content

Each translated page should contain the following elements in order:

  • The {{Other languages/Pagename}} template
  • The translated page title with the {{DISPLAYTITLE}} magic word: e.g., "{{DISPLAYTITLE:Nombre de la página}}" in Spanish (since Nombre de la página is Spanish for Pagename). This will cause the title of the article to be displayed as "Nombre de la página" rather than "Pagename/es".
  • The translated introduction
  • __TOC__ (to force the placement of the table of contents, since the first level heading would otherwise cause the table of contents to appear above that heading); if the page should have no table of contents, use __NOTOC__ instead
  • The remainder of the article, beginning with the first second level heading
  • A category for the languages, e.g., Category:Spanish pages

Need Input
Should we create a template to record the revision date of the base English page that this translation is based upon?

Create redirect

Create a redirect from the translated title to the appropriate subpage, e.g., a redirect page titled "Nombre de la página" would contain:

#REDIRECT [[Pagename/es]]

Translate the content

  • Make sure that any links to sections within the page (such as a link in this page to the Format the content section above) are translated so that the intrapage links will still work.
  • For links to other wiki pages, use {{langlink}}.
  • Translate, but otherwise maintain, all the headings to facilitate updates to the translation as the base English page is modified.

Extensions

The translation method described on this page relies on the ParserFunctions extension. This extension is already installed on the Tech wiki. If you are implementing this method of translation on another wiki, you must first install this extension prior to continuing on with the creation of the templates below.