Release status: stable | |
|---|---|
![]() | |
| Implementation | Parser function |
| Description | Adds aparser function to inform other users about language proficiency and categorize users of the same levels and languages. |
| Author(s) | Robert Leverington (RobertLtalk) |
| Latest version | Continuous updates |
| Compatibility policy | Master maintains backward compatibility. |
| MediaWiki | >= 1.43.0 |
| Database changes | Yes |
| Composer | mediawiki/babel |
| |
| License | GNU General Public License 2.0 or later |
| Download | Included in Language Extension Bundle |
| Example | Translatewiki.net |
| Translate the Babel extension if it is available at translatewiki.net | |
| Issues | Open tasks ·Report a bug |
TheBabel extension defines aparser function,#babel, that users can place on their user page to indicate their proficiency in different languages.This information can then additionally be stored via categories, allowing others to find users who speak any particular language.
This extension is meant to replace a previous system, also called "Babel" (in reference to theTower of Babel), which completely relied on templates. The idea originated onWikimedia Commons, then spread to other Wikimedia projects, and was later implemented on many other wikis.
The Babel extension still makes use of templates: if an unrecognized language parameter is specified, the extension will see if there is an existing template with that name and include that if so.
Babel folder to yourextensions/ directory.cdextensions/gitclonehttps://gerrit.wikimedia.org/r/mediawiki/extensions/BabelwfLoadExtension('Babel');
resources/ext.babel.less. You can change the style as desired by overriding them in the pageMediaWiki:Common.css.Syntax for the#babelparser function is as follows:
{{#babel: babelcode1| babelcode2| ...}}
Add one of the following codes for each language you speak or understand, separated by|, wherexx is the MediaWikilanguage code,ISO 639-1 code, orISO 639-3 code for the language (case-insensitive). The general usage of each code level is as follows:
xx-0xx-1xx-2xx-3xx-4xx orxx-Nxx-5To include any other template, add the name of the template, e.g., addUser CSS if you want to includeTemplate:User CSS.A prefix or suffix may be added to template names (e.g.,User at the beginning) depending on the local configuration.This can be used to restrict the selection and reduce the length of parameters; for example,CSS could includeTemplate:User CSS if configured in such a way.
For example in the mentioned case of CSS (Cascading Style Sheets), it might collide with the ISO code forSouthern Ohlone language.In such case, to enforce the usage of a local template, simply prefix the parameter with an underscore (_), e.g.… html-3|_css-2|js-1 ….
To remove the header and footer, useplain=1 as the first parameter, e.g.,{{#babel: plain=1| babelcode1| babelcode2| ...}}.This makes it easier to use Babel with other userboxes.
To hide categories, use thenocat=1 parameter as the first parameter, e.g.,{{#babel: nocat=1| babelcode1| babelcode2| ...}}.
Please note that only one of the parameters above is allowed.At the moment, it is not possible to use both parameters; for example,{{#babel: nocat=1| plain=1| babelcode1| babelcode2| ...}} will not work.
If categorization is enabled, the extension creates categories using theBabel AutoCreate bot with the text specified inMediaWiki:babel-autocreate-text-levels andMediaWiki:babel-autocreate-text-main.With basic settings, the categories that the bot creates are not categorized, and to fix this, it is recommended to do the following:
{{Babel category|level=$1|language=$2|ISO=$3}}
{{Babel category|language=$1|ISO=$2}}
This will allow you to categorize categories automatically, and if something happens, you can simultaneously replace the categorization and text in all categories.
Babel has several configuration parameters which can be modified inLocalSettings.php.
$wgBabelLanguageCodesCdb$wgBabelLanguageNamesCdb$wgBabelCategoryNames%code% (language code),%wikiname% (the name of the language in the wiki's content language), and%nativename% (the name of the language in its language). To disable adding a category for a particular level, set the corresponding value to false.$wgBabelCategoryNames=['0'=>'User %code%-0','1'=>'User %code%-1','2'=>'User %code%-2','3'=>'User %code%-3','4'=>'User %code%-4','5'=>'User %code%-5','N'=>'User %code%-N',];
$wgBabelMainCategory$wgBabelCategoryNames above. Example:$wgBabelMainCategory='User %code%';$wgBabelDefaultLevel$wgBabelCategoryNames, that is one of the strings "1", "2", … "5", "N". Default is "N".$wgBabelUseUserLanguage$wgBabelCategorizeNamespaces$wgBabelCategorizeNamespaces=[NS_USER];, then Babel will only add categories to pages in the user namespace. The default is null, which means categorizing all namespaces.$wgBabelCategoryOverride$wgBabelAutoCreateSeveral customizations can also be made using MediaWiki namespace messages.
Template:User $1""Babel AutoCreate"Users in this category indicate they have skill level $1 for language $2.$4"$wgBabelMainCategory).Users in this category indicate their knowledge of language $1.$3"Babel user information"- to not display a header.m:User language"- to display no link in the header."- to not display a footer.:Category:Users by languages"$1"Get information about what languages the user knows
User to get information about
| This extension is being used on one or moreWikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia'sCommonSettings.php andInitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki'sSpecial:Version page. |
| This extension is included in the following wiki farms/hosts and/or packages: |