User:結衣/Template:Int/doc

From Valve Developer Community
Jump to: navigation, search
Edit-copy.png
This is a documentation subpage for User:結衣.
Don't forget to purge the contents of the base page upon creating or editing this subpage.  

Usage

The {{i18n}} template is used to localize common strings by key similarly to the magic word {{int:}}. This is a necessary template for the Valve Developer Community since site administrators have yet to add Extension:Translate for i18n support. This seeks to deprecate the unmaintainable and sub-optimal localization stack built on Template:Autolang, Template:Uselangflags, and Template:Uselang. It should be used for localizing small phrases of text and not for full-page translation (e.g., see Template:Doc, Template:Dictionary). Localizations are automatically transcluded based on the user’s {{PAGELANGUAGE}}. If a localization is non-existent, then a link to the hypothetical page is returned.

This template is technically a wrapper for {{int:}} and will behave identically for MediaWiki messages. Otherwise, it will emit the localizations for a given custom localization key. Custom localization keys are stored as sub-pages to {{i18n}}. Each sub-page of a localization key is named after a valid MediaWiki language code and stores the raw translation of its localization key. For example, the localization key sandbox could have the sub-pages en and ja whose contents are Sandbox and サンドボックス, respectively.

Parameters

Parameter Description Type Status
Localization Key 1 The localization key to substitute a translation for. String required

Examples

  • {{User:結衣/Template:Int}} is an invalid state: Exception: please specify a MediaWiki or custom i18n message!
  • {{User:結衣/Template:Int|mainpage}} yields: Main Page
  • {{User:結衣/Template:Int|blahblahblah}} requests an non-existent localization key: Warning: undefined localization key! Check if the key is misspelled or create the localization key blahblahblah.