Extension:Babel

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 many other wikis.

Installation

 * 1) Download the latest snapshot and extract it to your extensions directory.
 * 2) Copy the code from   file into your MediaWiki:Common.css&mdash;you can change it as desired.
 * 3) Add   to.
 * 4) Enjoy!

If the CLDR extension is found language names are taken from that (where translations are unavailable), otherwise built in MediaWiki language names and English defaults are used.

Usage
Syntax for the  parser function is as follows:

Add one of the following codes for each language you speak or understand, separated by, where   is the MediaWiki language code, ISO 639-1 code, or ISO 639-3 code for the language. The general usage of each code level is as follows:
 * : If you don't understand the language at all.
 * : Basic ability - enough to understand written material or simple questions in this language.
 * : Intermediate ability - enough for editing or discussions.
 * : Advanced level - though you can write in this language with no problem, some small errors might occur.
 * : 'Near-native' level - although it's not your first language from birth, your ability is something like that of a native speaker.
 * : Professional proficiency.
 * or : Native speakers who use a language every day and have a thorough grasp of it, including colloquialisms and idioms.

To include any other template, simply add the name of the template, e.g. add  if you want to include. A prefix or suffix may be added to template names (e.g.  at the beginning) depending on the local configuration, this can be used to restrict the selection and reduce the length of parameters; for example   could include   if configured in such a way.

Configuration
Babel has four configuration variables which can be modified in.
 * : A boolean (true or false) indicating whether users should be entered in to a category if they use ; defaults to false.
 * : A boolean (true or false) indicating whether categories for abilities should be used; defaults to false.
 * : A boolean (true or false) indicating whether main categories featuring all users who specify a level for that language should be added to a  category; defaults to true.
 * : Space seperated file to parse for language codes, the default should suffice.
 * : Prefix to entries added to the object cache, defaults to.

Several customizations can also be made using MediaWiki namespace messages.
 * MediaWiki:babel-template-prefix and MediaWiki:babel-template-suffix : 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-suffix : 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-suffix : The prefix and suffix to be prepended or appended to the name of the categories.