Extension:Babel

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Babel

Release status: beta

Implementation Parser extension
Description Adds a parser function to inform other users about language proficiency and categorise users of the same levels and languages.
Author(s) MinuteElectron Talk
Version 0.9
MediaWiki 1.13 or higher
License GNU General Public License 2.0 or later
Download Source code
#Releases
Example Betawiki (early testsite)

The Babel extension adds a parser function to replace the old Babel system that completely relied on templates. The extension is backward compatible, and supports existing templates (they simply override extension functionality).

On Wikipedia, the noun Babel (in reference to the Tower of Babel) refers to the texts on user pages aiding multilingual communication by making it easier to contact someone who speaks a certain language. The idea originated on the Wikimedia Commons and has also been implemented on other wikis.

Contents

[edit] Installation

  1. Place the source code into extensions/Babel/.
  2. Copy the code from Babel.css file into your MediaWiki:Common.css—you can change it as desired.
  3. Add require_once( "extensions/Babel/Babel.php" ); to LocalSettings.php.
  4. Enjoy!

If the CLDR extension is found language names are taken from that, otherwise built in MediaWiki language names are used.

[edit] Usage

Syntax for the #babel parser function is as follows:

 {{#babel: babelcode1 | babelcode2 | ... }}
  • Add one of the following codes for each language you speak or understand, separated by |, where xx is the ISO 639-1 code or ISO 639-3 code for the language. The general usage of each code level is as follows:
    • xx-0 if you don't understand the language at all.
    • xx-1 for basic ability - enough to understand written material or simple questions in this language.
    • xx-2 for intermediate ability - enough for editing or discussions.
    • xx-3 for advanced level - though you can write in this language with no problem, some small errors might occur.
    • xx-4 for 'near-native' level - although it's not your first language from birth, your ability is something like that of a native speaker.
    • xx-5 for professional proficiency.
    • xx (no hyphen or number) for native speakers who use a language every day and have a thorough grasp of it, including colloquialisms and idioms.

[edit] Configuration

Babel has four configuration variables which can be modified in LocalSettings.php.

$wgBabelUseLevelZeroCategory 
A boolean (true or false) indicating whether users should be entered in to a category if they use xx-0; defaults to false.
$wgBabelUseSimpleCategories 
A boolean (true or false) indicating whether categories for abilities should be used; defaults to false.
$wgBabelUseMainCategories 
A boolean (true or false) indicating whether main categories featuring all users who specify a level for that language should be added to a xx category; defaults to true.
$wgBabelFavorStandard 
Which ISO language code standard should be favoured, either ISO_639_1 or ISO 639_3; it has not been tested using ISO_639_3 yet and defaults to ISO_639_1.

Several customizations can also be made using MediaWiki namespace messages.

MediaWiki:babel-template-prefix and MediaWiki:babel-template-prefix 
The prefix and suffix to be prepended or appended to the template name when one is being included.
MediaWiki:babel-portal-prefix and MediaWiki:babel-portal-prefix 
The prefix and suffix to be prepended or appended to the target of the link from the language code.
MediaWiki:babel-category-prefix and MediaWiki:babel-category-prefix 
The prefix and suffix to be prepended or appended to the name of the categories.

[edit] Releases

Version Release date Comments
0.1 2008-04-19 Initial version.
0.7 2008-04-26 First beta.
0.9 2008-05 Second beta - still some known issues.
Personal tools