Jump to content
MediaWiki

Extension:LanguageTag

From mediawiki.org

This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored.

If you are interested in taking on the task of developing and maintaining this extension, you can request repository ownership. As a courtesy, you may want to contact the author. You should also remove this template and list yourself as maintaining the extension in the page's {{Extension }} infobox.

MediaWiki extensions manual
LanguageTag
Release status: unmaintained
Implementation Tag , Locale
Description Allows to use XML-style language tags to markup different languages, and display them properly
Author(s) István Király (LaKing talk )
Latest version 1.2.0
MediaWiki 1.29+
PHP 5.4+
Database changes No
  • $wgLanguageTagLanguages
Licence GNU General Public License (any version)
Download
Translate the LanguageTag extension if it is available at translatewiki.net

The LanguageTag extension allows to use XML-style language tags to markup different languages, and display them according the markup, and the user language setting.
This extension may and should be used together with the UniversalLanguageSelector extension, to give the user the ability to choose his locale.

Usage

[edit ]

It can be used on a per-page basis. Installed and activated it will parse XML language tags, like <en>text</en> and display it only if the user language is english.

Example
<en>'''This''' is some text in English. It will only be visible for users in English locale.</en>
<de>Dies ist ein deutschsprachiger Text.</de>
<hu>Ez a mediawiki magyar hangja. Írásban.</hu>

If the user Language does not match, the extension will include the text in the html page, as a comment.

Installation

[edit ]
  • Download and move the extracted LanguageTag folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:
    cdextensions/
    gitclonehttps://gerrit.wikimedia.org/r/mediawiki/extensions/LanguageTag
    
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'LanguageTag' );
    $wgLanguageTagLanguages = array( "en", "de", "hu" ); // Adjust that array to set what language tag's should be parsed.
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

AltStyle によって変換されたページ (->オリジナル) /