Template:Localized media/doc
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. |
Purpose
[edit]This template is used to show localized images (and another media) in the language of the current page. Users can be create localized version of screenshots, diagrams etc., which the standardized form of file name File_name lang_code.file_extension
(e.g. File:Sysopdeleteform el.png), where «lang_code» is a valid language code. In various cases, the language code can be separated by different delimiter characters.
The template first checks «content language» of the current page (this check based on suffix of page name, e. g. Template:Sysophelp/doc/el; this indicating that it is translated). Then it checks if the file name given as a first parameter has a translation in that language (e. g. File:Sysopdeleteform el.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:Sysopdeleteform.png).
Parameters
[edit]May be used with named or unnamed parameters:
- filename (required) â image file name, without extension, language code and delimitation symbol;
- ext (optional) â file extension, «png» by default;
- delim (optional) â delimitation symbol for language code, space by default.
How to use
[edit]{{Localized media | filename without extension | file extension}}
{{LM | filename without extension | file extension}}
{{lm | filename without extension | file extension}}
If the file extension is not specified, png
is used by default.
Example 1
[edit](from meta:Administrator)
{{Localized media | Sysopdeleteform | png}}
or{{LM | Sysopdeleteform | png}}
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
[edit]{{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).
Note
[edit]This is a cross-wiki template. The same code is used on:
See also
[edit]