Rozšíření:Babylón
![]() Stav rozšíření: stabilní |
|
---|---|
![]() |
|
Zavádění | Rozšíření syntaktického analyzátoru |
Popis | Přidává parser function, která informuje ostatní uživatele o jazykových znalostech daného uživatele a kategorizuje uživatele stejných úrovní a jazyků. |
Napsal(i) | Robert Leverington (RobertLdiskuse) |
Nejnovější verze | Continuous updates |
Zásady kompatibility | Hlavní vývojová větev je zpětně kompatibilní. |
MediaWiki | 1.36+ |
Změny v databázi | dělá |
Composer | mediawiki/babel |
Tabulky | babel |
Licence | GNU General Public License 2.0 nebo pozdější |
Zdrojový kód | Zahrnuto v balíčku jazykových rozšíření |
Příklad | Translatewiki.net |
|
|
Quarterly downloads | 137 (Ranked 69th) |
Public wikis using | 2,668 (Ranked 41st) |
Přeložte rozšíření Babel, používá-li lokalizaci z translatewiki.net | |
Problémy | Otevřené úkoly · Nahlásit chybu |
Rozšíření Babylón přidává parser function, funkci která nahrazuje starý systém Babylón, který zcela spoléhal na šablony. Pokud je zadán parametr nerozpoznaného jazyka, uvidí, zda existuje šablona s názvem, a případně ji zahrne.
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.
Ke stažení
Rozšíření lze získat přímo z Git [?]:
- Procházet kód
- Některá rozšíření mají značky pro stabilní vydání.
- Procházet značky
- Vyberte značku
- Klikněte na "snímek"
- Každá větev je spojena s minulým vydáním MediaWiki. Existuje také "hlavní" větev obsahující nejnovější verzi alfa (může vyžadovat alfa verzi MediaWiki).
- Procházet větve
- Vyberte název větve
- Klikněte na "Pokračovat"
Rozbalte snímek a umístěte jej do adresáře extensions/Babel/ vaší instalace MediaWiki.
Pokud jste obeznámeni s Gitem a máte shell přístup k serveru, můžete také získat rozšíření takto:
cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git
Instalace
- Stáhněte soubor/y a vložte je do adresáře pojmenovaného
Babel
ve vaší složceextensions/
. - Následující kód přidejte na konec vašeho souboru
LocalSettings.php
:wfLoadExtension( 'Babel' );
- Vyžaduje nastavení v konfiguračním souboru.
- Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.
- CSS se nachází v souboru
resources/ext.babel.css
. Styl můžete změnit podle potřeby jeho přepsáním na stránceMediaWiki:Common.css
. - If the Rozšíření: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.
Použití
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
- Pokud nerozumíte danému jazyku.
xx-1
- Základní znalost jazyku. Dokážete pochopit základní text a otázky v daném jazyce.
xx-2
- Středně pokročilá schopnost. Dokážete provádět úpravy textu nebo diskutovat s ostatními.
xx-3
- Pokročilá úroveň. Ovládáte tento jazyk, ale mohou se vyskytnout drobné chyby.
xx-4
- "Téměř rodilý mluvčí". Není to Váš první jazyk, ale blížíte se téměř rodilému mluvčímu.
xx-5
- Profesionální znalost jazyka.
xx
neboxx-N
- Rodilí mluvčí, kteří používají jazyk každý den a dokonale jej ovládají, včetně hovorových výrazů a idiomů.
To include any other template, simply add the name of the template, e.g., add User from London
if you want to include Template:User from London
. 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 from London
could include Template:User from London
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.
Configuration
Configuration parameters
Babel has six configuration parameters which can be modified in LocalSettings.php
.
$wgBabelLanguageCodesCdb
- (string) the path of the language code database file, the default should suffice.
$wgBabelLanguageNamesCdb
- (string) the path of the language name database file, the default should suffice.
$wgBabelCategoryNames
- (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:
%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.
Například:
$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',
];
- will use categories like "Category:User en-0" and "Category:User fr-N". The default is just "Category:Fr-N" and so on.
$wgBabelMainCategory
- (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
$wgBabelCategoryNames
above. Example:$wgBabelMainCategory = 'User %code%';
$wgBabelDefaultLevel
- (string) Default ability level to use when none is specified, should be an index from
$wgBabelCategoryNames
, that is one of the strings "1", "2", … "5", "N". Default is "N". $wgBabelUseUserLanguage
- (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.
$wgBabelCategorizeNamespaces
- Array of namespaces to only add automatic categorization to. For example, if
$wgBabelCategorizeNamespaces = [ NS_USER ];
, then Babel will only add categories to pages in the user namespace. The default is null, which means categorize all namespaces.
Systémové zprávy
Several customizations can also be made using MediaWiki namespace messages.
- MediaWiki:babel-template "
Template:User $1
" - The format of template names when one is being included.
- MediaWiki:babel-portal "
"
- The format of the target of the link from the language code. Set to the empty string to not link the language code.
- MediaWiki:Babel-autocreate-user "
Babel AutoCreate
" - Username to be used for autocreation of Babel related categories
- MediaWiki:babel-autocreate-text-levels "
Uživatelé v této kategorii označili svou úroveň znalostí jazyka $2 jako $1.
" - Text to insert into auto-created categories for different language levels. You have to change this if you want them to be auto-categorized in the main category of the respective language (
$wgBabelMainCategory
). - MediaWiki:babel-autocreate-text-main "
Uživatelé v této kategorii se přihlásili ke znalosti jazyka $1.
" - Text to insert into auto-created categories for non-level categories. You have to change this if you want them to be auto-categorized in a parent category for all languages.
- MediaWiki:babel "
Babylon – informace o uživateli
" - The header of the babel box. Set to
-
to not display a header. - MediaWiki:babel-url "
Project:Babylon
" - The pagename where information on the babel extension can be found. Set to
-
to display no link in the header. - MediaWiki:Babel-footer "
Uživatelé podle jazyka
" - The footer of the babel box. Set to
-
to not display a footer. - MediaWiki:babel-footer-url "
:Kategorie:Babylon – Uživatelé podle jazyka
" - The page to link to in the footer of the babel box
API
meta=babel (bab)
- This module requires read rights.
- Source: Babel
- License: GPL-2.0-or-later
Get information about what languages the user knows
- babuser
User to get information about
- This parameter is required.
- Type: user, by any of username, IP, IP range and interwiki name (e.g. "prefix>ExampleName")
- Get the Babel information for user Example
- api.php?action=query&meta=babel&babuser=Example [open in sandbox]
Toto rozšíření se používá na jednom nebo více Wikimediálních projektech. Pravděpodobně to znamená, že rozšíření je stabilní a funguje dostatečně dobře, aby jej mohly používat weby s tak vysokou návštěvností. Vyhledejte tento název rozšíření v konfiguračních souborech Wikimedie CommonSettings.php a InitialiseSettings.php, abyste viděli, kde je nainstalováno. Úplný seznam rozšíření nainstalovaných na konkrétní wiki lze vidět na stránce wiki Special:Version. |
Toto rozšíření je zahrnuto v následujících balíčcích a/nebo wiki farmách: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |