Template:Locales Variables

From Okapi Framework
Jump to: navigation, search
  • ${srcLang} = Source language code as defined in the source Language field. For example: en-US.
  • ${srcLangU} = Source language code in uppercase. For example: EN-US.
  • ${srcLangL} = Source language code in lowercase. For example: en-us.
  • ${srcLoc} = Source locale code (language in lowercase, region in uppercase, with a _ separator). For example: en_US.
  • ${srcLocLang} = The language part of the source locale (in lowercase). For example: en.
  • ${srcLocReg} = The region part of the source locale (in uppercase). For example: US. Or empty if no region is specified.
  • ${trgLang} = Target language code as defined in the target Language field. For example: fr-CA.
  • ${trgLangU} = Target language code in uppercase. For example: FR-CA.
  • ${trgLangL} = Target language code in lowercase. For example: fr-ca.
  • ${trgLoc} = Target locale code (language in lowercase, region in uppercase, with a _ separator). For example: fr_CA.
  • ${trgLocLang} = The language part of the target locale (in lowercase). For example: fr.
  • ${trgLocReg} = The region part of the target locale (in uppercase). For example: CA. Or empty if no region is specified.

The names of the variables are case-sensitive. However, for backward compatibility, the first letter can be in uppercase (e.g. ${SrcLang}).

Any locale-related variable (i.e. has "Loc" in the variable name), has no predictable behaviour if the corresponding language code declared in the Languages and Encodings tab is not compatible with a locale notation.