The Babel extension adds a parser function to replace the old Babel system that completely relied on templates. If an unrecognized 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.
InstallationBabel
folder to your extensions/
directory.cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel
wfLoadExtension( 'Babel' );
resources/ext.babel.css
. You can change the style as desired by overriding them in the page MediaWiki:Common.css
.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 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:
xx-0
xx-1
xx-2
xx-3
xx-4
xx-5
xx
or xx-N
To include any other template, add the name of the template, e.g., add User CSS
if you want to include Template: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 include Template:User CSS
if configured in such a way.
To remove the header and footer, use plain=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 the nocat=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 the Babel AutoCreate bot with the text specified in MediaWiki:babel-autocreate-text-levels and MediaWiki: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.
Configuration Configuration parametersBabel has several configuration parameters which can be modified in LocalSettings.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
$wgBabelAutoCreate
Several 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:Babel - Users by language
"
$1
"
Get information about what languages the user knows
Specific parameter:
User to get information about
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4