Vorlage:Internationalization template doc: Unterschied zwischen den Versionen

Aus Stadtbahn-Wiki Bielefeld
Zur Navigation springen Zur Suche springen
K 1 Version importiert
K 1 Version importiert
 
(Eine dazwischenliegende Version von einem anderen Benutzer wird nicht angezeigt)
Zeile 13: Zeile 13:


== Parameter #1 ==
== Parameter #1 ==
* when no "="-sign occurs in the text (except at template transclusions), the "1=" is obsolete.  
* Removing of an existing "1=" is forbidden, even if it is not necessary, see [[Special:Diff/592488152#removing_1=]] (the "Law of 9/22").
{{Mbox|type=stop|image=[[File:Do not remove 1=.svg|48px]]|text=Since 2021-09-22, due to a proposal of a subcompetent user who misinterprets documentation,<br>a new rule for Commons prohibits the removal of superfluous names from positional parameters.}}
* when no free "="-sign occurs in the text the "1=" is obsolete. Not-free equal signs (inside of template transclusions) don't count. 
* without the "1=" but with one or more equal signs, <u>no parameter #1 can be detected</u>, and the error "parameter #1 is empty" is categorized.  
* without the "1=" but with one or more equal signs, <u>no parameter #1 can be detected</u>, and the error "parameter #1 is empty" is categorized.  
* As another error, a ''superflous'' pipe "{{!}}" character converts it to the contrary:
* As another error, a ''superflous'' pipe "{{!}}" character converts it to the contrary:
:* while e.g. <code><nowiki>{{en | some text | }}</nowiki></code> will be understood,  
:* while e.g. <code><nowiki>{{en | some text | }}</nowiki></code> will be understood,  
:* <code><nowiki>{{en |1=some text | }}</nowiki></code> causes the same error "parameter #1 is empty".
:* <code><nowiki>{{en |1=some text | }}</nowiki></code> causes the same error "parameter #1 is empty".
=== Required or necessary ===
When a parameter is <u>required</u> the template documentation expresses it with a line in the table, which left column shows the <code>parameter name</code>, then a textual description for the <code>parameter value</code>, and right (in this case) the code "required".
*A named parameter '''needs''' to be specified by <code>name=</code>, which may as well be an alias, 
*a positional parameter is specified either by its position '''or''' by the positional number (e.g. 1=, 2=, 3=...). With other words: the ''parameter value'' is '''''required''''', the ''parameter name'' (= the number) is ''optional''; it is '''not ''required''''' and not even ''suggested'' but it becomes ''necessary'' (another thing than the un/requiredness in the sense of template documentation!) when (and <u>only</u> when) the parameter value string contains a "free equal sign" (an equal sign ''outside'' of another template). The positional number is also necessary when positional parameters are specified ''outside of their positional order''.
   
   
|usage-notes =
|usage-notes =
Zeile 39: Zeile 45:
|1 = 1
|1 = 1
|1label = text
|1label = text
|1d-en = Text to be displayed. Please prepend "1=" to the text, otherwise any "=" characters in the text will [[#Parameter #1|break the template]].
|1d-en = Text to be displayed. Please prepend "1=" to the text, otherwise any free "=" characters in the text will [[#Parameter #1|break the template]].
|1d-td-en = Text to be displayed. <!-- TemplateData is used by tools which know wikitext better than most users. They should prepend the "1=" when needed, so if the user enters one manually, the result will be {{en|1=1=text}}... -->
|1d-td-en = Text to be displayed. <!-- TemplateData is used by tools which know wikitext better than most users. They should prepend the "1=" when needed, so if the user enters one manually, the result will be {{en|1=1=text}}... -->
|1type = string
|1type = string
|1default={{red|**error**}}
|1stat = required
|1stat = required
   
   

Aktuelle Version vom 9. Oktober 2021, 14:25 Uhr

Vorlage:Ifsandbox {{#invoke:Languages|autolang|base=TemplateBox/i18n |useargs=both |templateData={{#invoke:TemplateBox|templatedata}} |JSONFM={{#invoke:TemplateBox|templatedata|formatting=pretty}} |paramTable={{#invoke:TemplateBox|paramtable}} |usageSample={{#invoke:TemplateBox|usagesample}} |argCount={{#invoke:TemplateBox|argcount}} |desc={{#invoke:TemplateBox|description}}

|templateDataInfo=

{{#invoke:Autotranslate|autotranslate}}

|i18n-subpage=Template:En/ |usergroup=all |name=En }}

Other multi-lingual templates

Help for choosing the right template for your use case:
I18n templates: <templatestyles src="Template:Mono/styles.css"/>{{Multilingual description|lang=
|de,en,default=Deutsch/English
|fr=français
|...
}}
<templatestyles src="Template:Mono/styles.css"/>{{de|Deutsch}}
<templatestyles src="Template:Mono/styles.css"/>{{en|English}}
<templatestyles src="Template:Mono/styles.css"/>{{fr|français}}
...
<templatestyles src="Template:Mono/styles.css"/>{{LangSwitch|lang=
|de,en,default=Deutsch/English
|fr=français
|...
}}
<templatestyles src="Template:Mono/styles.css"/>{{Autotranslate}} <templatestyles src="Template:Mono/styles.css"/>{{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