Extension:I18nTags

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
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]

Browse source code
View code changes

Example translatewiki.net
Hooks used
ParserFirstCallInit

Check usage (experimental)

The i18nTags extension provides access to i18n functions for number formatting, grammar and plural in any available language.

[edit] Installation

  1. Download the latest snapshot and extract it to your extensions directory.
  2. Add
    require_once( "$IP/extensions/I18nTags/I18nTags.php" );
    to LocalSettings.php
  3. 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.
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox