Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:I18n templates: Difference between revisions

Template page
fixed typos: consistant, inconsistant → consistent, inconsistent
<languages/> makes no sense as long as this page is not translatable; folding place and lower fold limit are not “good” or “bad” (why would client-side folding be better, when it requires JavaScript and uses the reader’s CPU instead of Wikimedia’s?); neither Autotranslate nor TNT report invalid translations (they get never processed by these templates); fallback is in Autotranslate, not TNT; neither Autotranslate nor TNT takes /lang subpages into account (they are not even very machine-readable)
Line 1: Line 1:
<languages/>
<onlyinclude>{|class="wikitable" style="text-align:center"
<onlyinclude>{|class="wikitable" style="text-align:center"
|+ Help for choosing the right template for your use case:
|+ Help for choosing the right template for your use case:
Line 26: Line 25:
|-
|-
!scope="row" style="text-align:left"| Folding is done server-side
!scope="row" style="text-align:left"| Folding is done server-side
|colspan="2" style="background:#CFC"| No
|colspan="2" | No
|colspan="3" style="background:#FDD"| Yes
|colspan="3" | Yes
|-
|-
!scope="row" style="text-align:left"| Folding when at least ''n'' languages are provided
!scope="row" style="text-align:left"| Folding when at least ''n'' languages are provided
|style="background:#FFC"| 1 (all translations are shown without folding if the preferred language selected by the user has no matching translation)
| 1 (all translations are shown without folding if the preferred language selected by the user has no matching translation)
|style="background:#FDD"| 4
| 4
|colspan="3" style="background:#CFC"| 1
|colspan="3" | 1
|-
|-
!scope="row" style="text-align:left"| Detection of duplicate, incorrect, or unsupported language codes
!scope="row" style="text-align:left"| Detection of duplicate, incorrect, or unsupported language codes
|style="background:#CFC"| Yes
|style="background:#CFC"| Yes
|style="background:#FDD"| No
|style="background:#FDD"| No
|colspan="3" style="background:#CFC"| Yes
|style="background:#CFC"| Yes
|colspan="2" style="background:#FFC"| Duplicate language codes are impossible by design. Incorrect or unsupported codes are never displayed, but not reported. The Translate extension's interface (if it's used on the translation subpages) doesn't let the user create translations with invalid codes, but other methods (e.g. entering the translation's URL directly) allow it without any warning.
|-
|-
!scope="row" style="text-align:left"| Allows the same translation to be used for several languages
!scope="row" style="text-align:left"| Allows the same translation to be used for several languages
Line 46: Line 46:
!scope="row" style="text-align:left"| Supports language fallbacks
!scope="row" style="text-align:left"| Supports language fallbacks
|colspan="2" style="background:#FDD"| No
|colspan="2" style="background:#FDD"| No
|style="background:#CFC"| Yes
|colspan="2" style="background:#CFC"| Yes
|style="background:#FDD"| No
|style="background:#FDD"| No
|style="background:#CFC"| Yes
|-
|-
!scope="row" style="text-align:left"| Collation order of languages (when not folded)
!scope="row" style="text-align:left"| Collation order of languages (when not folded)
Line 69: Line 68:
!scope="row" style="text-align:left"| Contains expensive parser functions
!scope="row" style="text-align:left"| Contains expensive parser functions
|colspan="3" style="background:#CFC"| No
|colspan="3" style="background:#CFC"| No
|colspan="2" style="background:#FDD"| Yes (unless there's an editable <code>/lang</code> subpage listing all the existing translations selected with a {{tl|LangSwitch}})
|style="background:#FDD"| Yes, checks for several translations along the fallback chain until finds a suitable
|style="background:#FDD"| Yes, 2–4 checks per call
|}</onlyinclude>{{Documentation|Template:I18n templates/doc}}<!-- put categories and docu for this template on its /doc subpage --></noinclude>
|}</onlyinclude>{{Documentation|Template:I18n templates/doc}}<!-- put categories and docu for this template on its /doc subpage --></noinclude>

Revision as of 20:52, 21 May 2020

Help for choosing the right template for your use case:
I18n templates: {{Multilingual description|lang=
|de,en,default=Deutsch/English
|fr=français
|...
}}
{{de|Deutsch}}
{{en|English}}
{{fr|français}}
...
{{LangSwitch|lang=
|de,en,default=Deutsch/English
|fr=français
|...
}}
{{Autotranslate}} {{TNT}}
Recommended use at Categories, galleries File description pages (deprecated, can be safely replaced by {{Multilingual description}}) Small templates, whenever the previous options are not suitable (removes the visual indication of the language before each translated text) Data tables with translated cells or larger templates, when used on pages that do not have language subpages (e.g. not having Main page/en, Main page/de) and where the language displayed will be automatically determined by the language set in user preferences Data tables with translated cells or larger templates, when used on pages that do have language subpages; most of the time these will be pages prepared with the Translate Extension
Requires JavaScript enabled for folding Yes No
Folding can be disabled by user Yes No
Folding is done server-side No Yes
Folding when at least n languages are provided 1 (all translations are shown without folding if the preferred language selected by the user has no matching translation) 4 1
Detection of duplicate, incorrect, or unsupported language codes Yes No Yes Duplicate language codes are impossible by design. Incorrect or unsupported codes are never displayed, but not reported. The Translate extension's interface (if it's used on the translation subpages) doesn't let the user create translations with invalid codes, but other methods (e.g. entering the translation's URL directly) allow it without any warning.
Allows the same translation to be used for several languages Yes No Yes
Supports language fallbacks No Yes No
Collation order of languages (when not folded) Consistent order by native language name, languages grouped by script:
  • LTR scripts: Latin, Latin or Cyrillic, Cyrillic, Greek, other simple LTR alphabets (Armenian, Georgian, etc.), abugidas (North Indian, South Indian, other South-East Asian, etc.), syllabaries (European, American, African, Asian), Korean alphabets (basic Jamos, Hangul including some sinograms), Japanese syllabaries (including some sinograms), sinograms (including some syllabaries)
  • RTL scripts: Hebrew, Arabic, other RTL abjads (Divehi, etc.), RTL syllabaries (N'ko)
As provided by the user in the wikitext (any inconsistent order may be difficult to lookup visually) N/A
Search indexing issues No (all translations are included on the same page, however search results may be less relevant with many languages mixed) Yes (may not index all languages depending on search engines, unless there's a list of links for visiting other languages) Partially (where used; language subpages of templates are indexed) No (translated pages should include a <languages/> navigation bar for visiting other languages)
Page size issues Yes (may exhaust size or time limits in the wiki parser if many languages are included; larger pages to download for all visitors; slower navigation for visitors with slow Internet access; may be costly for visitors with limited data plans) No (only the content for the selected language or a suitable fallback language is present in the generated page)
Contains expensive parser functions No Yes, checks for several translations along the fallback chain until finds a suitable Yes, 2–4 checks per call
Template documentation[ view · edit · history · purge ]
This documentation is transcluded from Template:I18n templates/doc.

This template is used as info in i18n template documentations and has no parameters

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
No parameters specified
Cookies help us deliver our services. By using our services, you agree to our use of cookies.