Template:LanguageSwitch: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
Pgehres (WMF) (talk | contribs)
No edit summary
Jsoby (talk | contribs)
adding sitename parameter
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#ifexist: Template:{{{1}}}/{{{2}}}/{{{3}}}
{{#ifexist: Template:{{{1}}}/{{{2}}}/{{{3}}}
|lang_COUNTRY{{ {{{1}}}/{{{2}}}/{{{3}}} }}
|{{{{{1}}}/{{{2}}}/{{{3}}}|{{{2}}}|country={{{3}}}|sitename={{{sitename}}}}}
|{{#ifexist: Template:{{{1}}}/{{{2}}}
|{{#ifexist: Template:{{{1}}}/{{{2}}}
|lang{{ {{{1}}}/{{{2}}} }}
|{{{{{1}}}/{{{2}}}|{{{2}}}|country={{{3}}}|sitename={{{sitename}}}}}
|default({{{1}}}-{{{2}}}){{ {{{1}}}/en }}
|{{{{{1}}}/en|en|country={{{3}}}|sitename={{{sitename}}}}}
}}
}}
}}<noinclude>
}}<noinclude>
----
----
Automatically selects the best localized subpage for various fundraiser templates, based on the language and country passes to the template.
Automatically selects the best localized subpage for various fundraiser templates, based on the language and country passes to the template. This template also passes the language code along as a template parameter.
e.g. <nowiki>{{FRLocalize|appeal-title}}</nowiki> when passed uselang=fr and country=CA
e.g. <nowiki>{{FRLocalize|appeal-title}}</nowiki> when passed uselang=fr and country=CA
* Will display Template:appeal-title/fr/CA if it exists, else
* Will display Template:appeal-title/fr/CA and sends fr if it exists, else
* Will display Template:appeal-title/fr if it exists, else
* Will display Template:appeal-title/fr and sends fr if it exists, else
* Falls back to Template:appeal-title/en
* Falls back to Template:appeal-title/en and sends en
</noinclude>
</noinclude>

Latest revision as of 22:33, 23 November 2011

{{{{{1}}}/en|en|country={{{3}}}|sitename={{{sitename}}}}}


Automatically selects the best localized subpage for various fundraiser templates, based on the language and country passes to the template. This template also passes the language code along as a template parameter. e.g. {{FRLocalize|appeal-title}} when passed uselang=fr and country=CA

  • Will display Template:appeal-title/fr/CA and sends fr if it exists, else
  • Will display Template:appeal-title/fr and sends fr if it exists, else
  • Falls back to Template:appeal-title/en and sends en