Template:Localized media/doc

From Miranda NG
< Template:Localized media
Revision as of 12:19, 13 June 2018 by Goraf (talk | contribs) (add shortcut template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is a documentation subpage for Template:Localized media .
It contains usage information, categories and other content that is not part of the original template page.

shortcut: Template:Lm

Purpose

This template is used to show localized images (and another media) in the language of the current page. Users can create localized version of screenshots, diagrams etc., with the standardized form of file name File_name LANG_CODE.file_extension (e.g., File:Example DE.png), where «LANG_CODE» is a valid language code in upper case. In various cases, the language code can be separated by different delimiter characters.

The template first checks content language of the current page using magic word {{PAGELANGUAGE}}. Then it checks if the file name given as a first parameter has a translation in that language (e.g., File:Example DE.png).

If the current page name is not suffixed with a valid language code, or if the localized file doesn't exist in that language, it will display the file with base file name (e.g., File:Example.png).

Parameters

May be used with named or unnamed parameters:

  1. filename (required) — image file name, without extension, language code and delimitation symbol;
  2. ext (optional) — file extension, «png» by default;
  3. delim (optional) — delimitation symbol for language code, space by default.

How to use

  • {{Localized media | filename without extension | file extension | delimiter}}
  • {{Localized media | filename = filename without extension | ext = file extension | delim = delimiter}}
  • {{LM | filename without extension | file extension | delimiter}}
  • {{LM | filename = filename without extension | ext = file extension | delim = delimiter}}

If the file extension is not specified, png is used by default.

Example 1

  • {{Localized media | Sysopdeleteform}} or
  • {{LM | Sysopdeleteform}}

which includes translated versions of File:Sysopdeleteform.png (such as File:Sysopdeleteform DE.png for German) if it exists in the same language as the current page, or the base (most often English) version if such translation doesn't exist in that language.

Example 2

  • {{Localized media | Wikipedia-logo-v2 | svg | -}} or
  • {{LM | Wikipedia-logo-v2 | svg | -}} or
  • {{LM |filename = Wikipedia-logo-v2 |ext = svg |delim = -}}

which includes translated versions of File:Wikipedia-logo-v2-en.svg (such as File:Wikipedia-logo-v2-DE.svg for German).

Source

Code initially taken from Mediawiki - Template:Localized_media

See also