Meta:Templates for translating language names

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search

This page is about using templates to translate names of languages into another language. For example, in German the name of the English language is Englisch. There are many applications in which multilingual lists of language names are needed — for example, the List of Wikipedias (there are currently ca. 260). More generally people often like to refer to other languages they don't know and give the translation of the language name for people who do read that language.

{{#language:code}} gives the language name of selected RFC 3066 language codes, otherwise it returns the input value as is. For a complete list see the IANA registry.

{{#language:da}} gives dansk [1]
{{#language:fo}} gives føroyskt [2]
{{#language:zh}} gives 中文 [3]
{{#language:zh-min-nan}} gives Bân-lâm-gú [4]
{{#language:ang}} gives Ænglisc [5]
{{#language:tlh}} gives tlh [6] (missing, incomplete list)
{{#language:frr}} gives Nordfriisk [7] (missing, introduced 2006)
{{#language:mw}} gives mw [8] (no language code as of 2006)

This function will replace Template:N local and some of the Lang name templates. For actually supported alpha2 and alpha3 codes see Template:Sttnw, the 27*26*26 template calls may take some time.

We can use

Template:Lang name - en (de) containing "Englisch<noinclude>[[Category:Lang name templates]]

</noinclude>" where the ISO 639 language codes are used to index the languages.

Examples:

Germans call the English language "{{Lang name - en (de)}}".

gives:

  • Germans call the English language "Englisch".

My native language is English ({{Lang name - en (zh)}}, {{Lang name - en (es)}}, {{Lang name - en (ru)}}).

gives:

  • My native language is English (英语, Inglés, Английский).

About 100 such templates exist as of April 2005 [9]. But this is far from the 62,500 required to inter-translate the 250 languages for which Wikipedias exist.

Another possible solution is like Template:N en, giving the names in English of many languages. This approach would only require 250 of such larger templates.

Of these there is also Template:N ko, and some small ones, not yet using "#switch":

  • Template:n de containing "{{p{{{1}}}|af=Afrikaans|de=Deutsch|en=English|fr=Französisch|nl=Niederländisch}}"
  • Template:n eo containing "{{p{{{1}}}}}"
  • Template:n fi containing "{{p{{{1}}}|fi=Suomi}}"
  • Template:n fr containing "{{p{{{1}}}|de=Allemand}}"
  • Template:n nl containing "{{p{{{1}}}|de=Duits|en=Engels|eo=Esperanto|es=Spaans|fr=Frans|nl=Nederlands|ru=Russisch}}"
  • Template:n ru containing "{{p{{{1}}}|ru=Русский}}"

Template:Languages allows for 232 languages to provide parameters with data per language, and outputs these data along with language code, English language name, and local language name, sorted in alphabetical order, and with or without languages without data.

The main issues for discussion are how to use templates, what to name them, and various issues concerning their content (capitalization and so forth). The examples above use what seems to be the most developed solution so far. See also the talk page.

More generally, a template may contain any information depending on language, e.g. Template:N wiki article containing the name of the page in the English Wikipedia about the language, with prefix "w:".

Templates containing a text in multiple languages

We can also put multiple translations of one language name in a template, e.g.:

  • Template:nen containing "{{p{{{1}}}|de=Englisch|en=English|es=Inglés|ja=英語}}"
  • Template:nde containing "{{p{{{1}}}|de=Deutsch|en=German|fr=Allemand|it=Tedesco|ja=ドイツ語|nl=Duits|zh=徳語}}"

This can be generalized: we can put multiple translations of any text in a template, e.g.:

We can distinguish templates producing the whole list, like the last two, and templates that, based on a language parameter, produce the translation in the selected language.

See also Meta:Translation/Coordination/List/Main.

See also