Шаблон:Langcode/doc
55px | langSwitch}} {{#invoke:LangSwitch|langSwitch}} {{#invoke:LangSwitch|langSwitch}} {{#invoke:LangSwitch|langSwitch}} {{#invoke:LangSwitch|langSwitch}} [{{#invoke:LangSwitch|langSwitch}}] |
Usage[ред.]
This template extracts the ISO 639 language identifier from the page name. Call simply as {{langcode}}. To keep compatibility with templates that use the {{langcode|{{{lang|}}}}} syntax this template returns its first argument if given. Note that this stops Mediawiki from caching the page, but this template is more optimised than older versions. Non-language prefixes such as Key:, Tag: and Relation: are handled correctly. Pages without a colon in the name are reported as the page content language set in the wiki (“Мова вмісту сторінки” under “Інформація про сторінку”). This defaults to English for new pages. The page content language is always returned if it isn’t English.
Implementation[ред.]
The arguments to #invoke are pseudonamespace/language pairs, for instance Key=en means that pages with names beginning with Key: are in English. Prefixes such as Pt: directly corresponding to languages do not have to be added here because the Scribunto module returns the beginning of the page name in lower case if it doesn’t match any of the arguments.
See also[ред.]
- {{LangSwitch}}