Extension:I18nTags
From MediaWiki.org
|
I18nTags Release status: stable |
|||
|---|---|---|---|
| Implementation | Tag, Parser functions | ||
| Description | Access the i18n functions for number formatting, grammar and plural in any available language | ||
| Author(s) | Niklas Laxström (NikerabbitTalk) | ||
| License | No license specified | ||
| Download | Download snapshot Subversion [Help] |
||
| Example | translatewiki.net | ||
|
|||
|
Check usage (experimental) |
|||
The i18nTags extension provides access to i18n functions for number formatting, grammar and plural in any available language.
[edit] Installation
- Download the latest snapshot and extract it to your extensions directory.
- Add
to LocalSettings.phprequire_once( "$IP/extensions/I18nTags/I18nTags.php" );
- The extension should be now active.
Optional: install the cldr extension to get languages names in any language.
[edit] Features
- This section is outdated, see the discussion page
- {{#languagename:}}
- Get the language's name in the user language. You can override the user language by passing in a language code (or 'native') as an additional parameter.
| Syntax | User language | Output |
|---|---|---|
| {{#languagename:fr}} | English | French |
| {{#languagename:fr}} | German | Französisch |
| {{#languagename:fr|de}} | Any | Französisch |
| {{#languagename:fr|fr}} | Any | Français |
| {{#languagename:fr|native}} | Any | Français |
- <formatnum>
- Like {{#formatnum:}} but for any language. To choose the language, use <formatnum lang="..."></formatnum>.
- <grammar>
- Like {{#grammar:}} but for any language. To choose the language, use <grammar lang="..."></grammar>.
- <plural>
- Like {{#plural:}} but for any language. To choose the language, use <plural lang="..."></plural>.
- <linktrail>
- Emulates the linktrail for a specific language.