Extension:Babel

The Babel extension adds a parser function to replace the old Babel system that completely relied on templates. If an unrecognised language parameter is specified, it will see if there is an existing template with the name and include that.

On Wikimedia projects, 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)  or download a snapshot. Choose the version that matches your version of MediaWiki.


 * 1) Create a directory   in your   directory.


 * 1) Extract the files to this   directory.


 * 1) Add   to the bottom of LocalSettings.php.


 * 1) The CSS is located in the file  . You can change the style as desired by overriding them in the page  . Prior to version  you had to copy all the CSS to MediaWiki:Common.css.


 * 1) Installation can now be verified through Special:Version of your wiki.

If the 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.

<tvar|xx-5> </>: Professional proficiency.

<tvar|xx> </> or <tvar|xx-N> </>: 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 six configuration variables which can be modified in <tvar|ls> </>.


 * <tvar|var> </> : (string) the path of the language code database file, the default should suffice.


 * <tvar|var> </> : (string) the path of the language name database file, the default should suffice.


 * <tvar|var> </> : (array of string or boolean, indexed by the strings "1", "2", … "5", "N") where each entry is the name of a category for the skill level indicated by its index, possible variable elements are: <tvar|1><tt>%code%</tt></> (language code), <tvar|2><tt>%wikiname%</tt></> (the name of the language in the wiki's content language), and <tvar|3><tt>%nativename%</tt></> (the name of the language in its language). To disable adding a category for a particular level, set the corresponding value to false.


 * For example:


 * will use categories like "<tvar|1>Category:User en-0</>" and "<tvar|2>Category:User fr-N</>". The default is just "<tvar|3>Category:Fr-N</>" and so on.


 * <tvar|var> </> : (string) Name of the main (non-level) category for each language, to which all users of that language are added. Set to false to disable; defaults to format "Category:Fr". It accepts the same format as  above. Example:
 * <tt>$wgBabelMainCategory = 'User %code%';</tt>


 * <tvar|var> </> : (string) Default ability level to use when none is specified, should be an index from, that is one of the strings "1", "2", … "5", "N". Default is "N".


 * <tvar|var> </> : (boolean) Whether to use the user interface language for the header and footer message. If false (default), it will be in the page content language. This is because using the user interface language may fragment the parser cache.

Several customizations can also be made using MediaWiki namespace messages.

The format of template names when one is being included. The format of the target of the link from the language code. Username to be used for autocreation of Babel related categories Text to insert into auto-created categories for different language levels. You have to change this if you want them to be auto-categorised in the main category of the respective language (<tvar|var> </>). Text to insert into auto-created categories for non-level categories. You have to change this if you want them to be auto-categorised in a parent category for all languages. The header of the babel box The pagename where information on the babel extension can be found The footer of the babel box The page to link to in the footer of the babel box
 * MediaWiki:babel-template :
 * MediaWiki:babel-portal :
 * MediaWiki:Babel-autocreate-user :
 * MediaWiki:babel-autocreate-text-levels :
 * MediaWiki:babel-autocreate-text-main :
 * MediaWiki:babel :
 * MediaWiki:babel-url :
 * MediaWiki:Babel-footer :
 * MediaWiki:babel-footer-url :