Extensão: Babel
Estado de lançamento: estável |
|
|---|---|
![]() |
|
| Implementação | Função do analisador |
| Descrição | Adiciona uma função de analisador para informar os outros utilizadores sobre a proficiência do idioma e categorizar os utilizadores dos mesmos níveis e idiomas. |
| Autor(es) | Robert Leverington (RobertLdiscussão) |
| Última versão | Atualizações contínuas |
| Política de compatibilidade | Original mantém a compatibilidade com versões anteriores. |
| MediaWiki | >= 1.43.0 |
| Alterações à base de dados | Sim |
| Composer | mediawiki/babel |
| Tabelas | babel |
| Licença | GNU - Licença Pública Geral 2.0 ou superior |
| Transferência | Incluída no 'Pacote da Extensão de Idiomas' |
| Exemplo | Translatewiki.net |
|
|
| Traduza a extensão Babel se esta estiver disponível em translatewiki.net | |
| Problemas | Tarefas em aberto · Reportar um erro |
A extensão Babel define uma função de analisar, #babel, que os utilizadores podem colocar nas suas páginas de utilizador para indicar a sua proficiência em idiomas diferentes.
Esta informação pode então ser guardada através das categorias, permitindo que outros encontrem os utilizadores que falam qualquer idioma em particular.
Esta extensão destina-se a substituir um sistema anterior, também chamado de "Babel" (em referência à Torre de Babel), que dependia completamente dos modelos. A ideia teve origem na Wikimédia Commons, depois espalhou-se para outros projetos da Wikimédia, e mais tarde foi implementada em muitas outras wikis.
A extensão Babel ainda utiliza modelos: se for especificado um parâmetro de idioma não reconhecido, a extensão verá se há um modelo existente com esse nome e incluirá, se sim.
Instalação
- Exporte e coloque o ficheiro, ou ficheiros, num diretório chamado
Babel, na sua pastaextensions/.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel
- Acrescente o seguinte código ao fundo do ficheiro $LocalSettings:
wfLoadExtension( 'Babel' );
- Execute o script de atualização que irá criar automaticamente as tabelas da base de dados necessárias para esta extensão.
- Configure conforme necessário.
Pronto – Na página especial Special:Version da sua wiki verifique se a extensão foi instalada.
- O CSS é gerado a partir do ficheiro
resources/ext.babel.less. Pode alterar o estilo conforme o desejado, substituindo-os na páginaMediaWiki:Common.css. - Se for encontrada a extensão CLDR, os nomes dos idiomas são retirados disso (onde as traduções não estão disponíveis), caso contrário, são utilizados os nomes de idioma do MediaWiki e as predefinições em inglês.
Utilização
A sintaxe para a função de analisar #babel é a seguinte:
{{#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 (case-insensitive). The general usage of each code level is as follows:
xx-0: If you don't understand the language at all.xx-1: Basic ability—enough to understand written material or simple questions in this language.xx-2: Intermediate ability—enough for editing or discussions.xx-3: Advanced level—though you can write in this language with no problem, some small errors might occur.xx-4: "Near-native" level—although it's not your first language from birth, your ability is something like that of a native speaker.xxorxx-N: Native speakers who use a language every day and have a thorough grasp of it, including colloquialisms and idioms.xx-5- Proficiência profissional - você é capaz de responder a perguntas sobre a utilização do idioma que podem ser efetuadas pelos falantes nativos.
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.
For example in the mentioned case of CSS (Cascading Style Sheets), it might collide with the ISO code for Southern 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 ….
Parâmetros
Para remover o cabeçalho e o rodapé , utilize plain=1 como o primeiro parâmetro, por exemplo, {{#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.
Categorização
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:
- Create a template {{Babel category}} that will generate categories.
- Replacing text on MediaWiki:babel-autocreate-text-levels with
{{Babel category|level=$1|language=$2|ISO=$3}}
- Replacing text on MediaWiki:babel-autocreate-text-main with
{{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.
Configuração
Parâmetros de configuração
Babel tem vários parâmetros de configuração que podem ser modificados em 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.
- Por exemplo:
$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
$wgBabelCategoryNamesabove. 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 categorizing all namespaces. $wgBabelCategoryOverride- Whether to allow Babel categories to be overridden on the wiki using MediaWiki:Babel-category-override
$wgBabelAutoCreate- Whether to auto-create categories.
Mensagens do sistema
Several customizations can also be made using MediaWiki namespace messages.
- MediaWiki:babel-template "
Template:Usuário $1" - The format of template names when one is being included.
- MediaWiki:babel-portal "
" - The format of the link's target 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 auto-creation of Babel related categories
- MediaWiki:babel-autocreate-text-levels "
Os utilizadores nesta categoria indicam que eles têm um nível de conhecimento $1 para o idioma $2. $4" - 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 "
Os utilizadores nesta categoria indicam que têm conhecimentos do idioma $1. $3" - 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 "
Informação do utilizador Babel" - O cabeçalho da caixa 'babel' Definir para
-para não exibir um cabeçalho. - MediaWiki:babel-url "
Project:Babel" - O nome da página onde a informação sobre a extensão 'babel' pode ser encontrada. Defina para
-para não exibir nenhuma hiperligação no cabeçalho. - MediaWiki:Babel-footer "
Utilizadores por idioma" - O rodapé da caixa 'babel'. Defina para
-para não exibir um rodapé. - MediaWiki:babel-footer-url "
:Category:Babel - Utilizadores por idioma" - A página para interligar no rodapé da caixa 'babel'
- MediaWiki:Babel-category-override "
$1" - Substitui quaisquer categorias de Babel geradas automaticamente. Parâmetros:
$1 = a categoria que seria gerada normalmente.
$2 = o código de idioma
$3 = o nível de 'babel'.
Quaisquer categorias substituídas com este método não serão criadas automaticamente para reduzir o risco de vandalismo ou edições erróneas para essa página.
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, Temporary user, 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]
| Este extensão está a ser utilizado em um ou mais projetos da Wikimedia. Isso provavelmente significa que a extensão é estável e funciona bem o suficiente para ser usada por esses sites de alto tráfego. Procure o nome desta extensão nos arquivos de configuração CommonSettings.php e InitialiseSettings.php da Wikimedia para ver onde está instalado. Uma lista completa das extensões instaladas em um determinado wiki pode ser vista na página Special:Version do wiki. |
| This extension is included in the following wiki farms/hosts and/or packages: |
- Stable extensions/pt
- Parser function extensions/pt
- Extensions supporting Composer/pt
- GPL licensed extensions/pt
- Extensions in Wikimedia version control/pt
- CommunityConfigurationProvider initList extensions/pt
- LinksUpdate extensions/pt
- LoadExtensionSchemaUpdates extensions/pt
- ParserFirstCallInit extensions/pt
- UserGetReservedNames extensions/pt
- All extensions/pt
- Extensions used on Wikimedia/pt
- Extensions included in Canasta/pt
- Extensions included in Miraheze/pt
- Extensions included in ShoutWiki/pt
- Extensions included in wiki.gg/pt
- Localisation extensions/pt

