Template:CountryLanguage: Difference between revisions
(Switch to variables.) |
(Removed carriage returns.) |
||
Line 258: | Line 258: | ||
{{#vardefine:Zambia|English}} | {{#vardefine:Zambia|English}} | ||
{{#vardefine:Zimbabwe|English}}<!-- Use switch to match on Country | {{#vardefine:Zimbabwe|English}}<!-- Use switch to match on Country | ||
--> | -->{{#switch: {{{1|}}} | ||
{{#switch: {{{1|}}} | |||
| Afghanistan = {{#switch: {{{2|1}}} | 3 = {{#explode:{{#var:Afghanistan}}|;|2}} | 2 = {{#explode:{{#var:Afghanistan}}|;|1}} | all = {{#var:Afghanistan}}| {{#explode:{{#var:Afghanistan}}|;|0}} }} | | Afghanistan = {{#switch: {{{2|1}}} | 3 = {{#explode:{{#var:Afghanistan}}|;|2}} | 2 = {{#explode:{{#var:Afghanistan}}|;|1}} | all = {{#var:Afghanistan}}| {{#explode:{{#var:Afghanistan}}|;|0}} }} | ||
| Albania = {{#switch: {{{2|1}}} | 3 = {{#explode:{{#var:Albania}}|;|2}} | 2 = {{#explode:{{#var:Albania}}|;|1}} | all = {{#var:Albania}}| {{#explode:{{#var:Albania}}|;|0}} }} | | Albania = {{#switch: {{{2|1}}} | 3 = {{#explode:{{#var:Albania}}|;|2}} | 2 = {{#explode:{{#var:Albania}}|;|1}} | all = {{#var:Albania}}| {{#explode:{{#var:Albania}}|;|0}} }} |
Revision as of 18:19, 2 January 2025
Country language lookup template
This will return the major languages based on Country as either the 1st, 2nd, 3rd, or all. The following are used together:
Usage:
{{CountryLanguage|<Country_Name>|<1,2,3,all>}}
The country is mandatory, if the primary (1st), secondary (2nd), tertiary (3rd), or all is blank, it assumes the primary language.