Estensione:Babel
![]() Stato della release: stabile |
|
---|---|
![]() |
|
Implementazione | Parser function |
Descrizione | Aggiunge una funzione parser per informare gli altri utenti riguardo le competenze linguistiche e categorizzare gli utenti con gli stessi livelli e lingue. |
Autore(i) | Robert Leverington (RobertLdiscussione) |
Versione | Continuous updates |
Politica di compatibilità | Master maintains backward compatibility. |
MediaWiki | 1.36+ |
Modifiche al Database | Sì |
Composer | mediawiki/babel |
Tabelle | babel |
Licenza | GNU General Public License 2.0 or later |
Scaricare | Included in Language Extension Bundle |
Esempio | Translatewiki.net |
|
|
Quarterly downloads | 107 (Ranked 70th) |
Public wikis using | 2,416 (Ranked 192nd) |
Traduci l'estensione Babel se è disponibile su translatewiki.net | |
Problemi | Compiti aperti · Riportare un bug |
L'estensione Babel aggiunge una funzione parser che sostituisce il vecchio sistema dei Babel completamente basato sui template. Nel caso in cui venisse specificata una lingua non riconosciuta come parametro, verrà mostrato il template con lo stesso nome qualora esistesse.
Sui progetti Wikimedia, il nome Babel (dal mito della Torre di Babele) fa riferimento alla tabella, presente sulle pagine Utente, che mirano a una comunicazione multilingue rendendo più facile contattare qualcuno che conosca una data lingua. L'idea è nata su Wikimedia Commons ed è stata poi implementata su molti altri progetti wiki.
Download
The extension can be retrieved directly from Git [?]:
- Browse code
- Some extensions have tags for stable releases.
- Browse tags
- Select the tag
- Click "snapshot"
- Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).
- Browse branches
- Select a branch name
- Click "Continua"
Extract the snapshot and place it in the extensions/Babel/ directory of your MediaWiki installation.
If you are familiar with Git and have shell access to your server, you can also obtain the extension as follows:
cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel.git
Installazione
- Download and place the file(s) in a directory called
Babel
in yourextensions/
folder. - Aggiungi il seguente codice al tuo $LocalSettings (preferibilmente alla fine):
wfLoadExtension( 'Babel' );
- Esegui lo script di aggiornamento, che creerà automaticamente nel database le tavole necessarie a questa estensione.
- Configure as required.
- Done – Naviga in Special:Version nella tua wiki per verificare che l'estensione sia stata installata correttamente.
- Il CSS si trova nel file
resources/ext.babel.css
. Si può cambiare lo stile a proprio piacimento disabilitandoli sulla paginaMediaWiki:Common.css
. - If the 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.
Uso
La sintassi per la funzione parser #babel
è la seguente:
{{#babel: babelcode1 | babelcode2 | ... }}
Aggiungi uno dei seguenti codici per ciascuna lingua che parli o capisci separati da |
. Il simbolo xx
rappresenta invece il codice lingua MediaWiki secondo gli standard ISO 639-1 oppure ISO 639-3. L'uso generale per ogni livello di codice è il seguente:
xx-0
- se non comprendi per niente la lingua.
xx-1
- Abilità di base - abbastanza per capire materiale scritto o domande semplici in questa lingua.
xx-2
- abilità intermedia - sufficiente per la modifica o discussioni.
xx-3
- Livello avanzato - anche se riesci a scrivere in questa lingua senza alcun problema, potrebbero verificarsi alcuni piccoli errori.
xx-4
- Livello "simil-nativo" - anche se non è la tua lingua madre, la tua capacità è simile a quella di un madrelingua.
xx-5
- Conoscenza professionale.
xx
oxx-N
- Madrelingua che utilizzano un linguaggio di ogni giorno e hanno una conoscenza approfondita di esso, comprese le espressioni colloquiali e i modi di dire.
Per aggiungere altri template, scrivi semplicemente il nome del template. Per esempio, aggiungi User from London
se vuoi includere Template:User from London
. Un prefisso o un suffisso può essere aggiunto al nome del template (p.es. User
all'inizio) a seconda delle impostazioni locali. Fare ciò può restringere la selezione e ridurre la lunghezza dei parametri.
Esempio: from London
potrebbe includere Template:User from London
se è stato configurato in questo modo.
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.
Configurazione
Configuration parameters
Babel ha sei variabili di configurazione che possono essere modificate in LocalSettings.php
.
$wgBabelLanguageCodesCdb
- ; $var : (stringa) indica il percorso (la posizione)del file contenente il codice della lingua nel database. Il valore di default dovrebbe essere sufficiente.
$wgBabelLanguageNamesCdb
- ; $var : (stringa) indica il percorso (la posizione)del file contenente il nome della lingua nel database. Il valore di default dovrebbe essere sufficiente.
$wgBabelCategoryNames
- ; $var : (array di stringhe o valori booleani, indicizzati dai valori "1", "2", … "5", "N"). Ogni valore immesso è il nome della categoria che identifica il livello di competenza indicato dall'indice. Possibili elementi sono:
%code%
(codice della lingua),%wikiname%
(nome della lingua nella versione wiki in considerazione), and%nativename%
(denominazione endonima della lingua). Disabilitare l'aggiunta di una categoria per un particolare livello, imposta il corrispondente valore vero o falso.
- Per esempio:
$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',
];
- Userà categorie come "Category:User en-0" e "Category:User fr-N". L'impostazione predefinita è solo "Category:Fr-N" e così via.
$wgBabelMainCategory
- ; $var : (stringa) valore della categoria principale (non il livello) per ogni lingua a cui vengono aggiunti tutti gli utenti che parlano quella lingua in particolare. Per disabilitare basta impostare il valore su "false"; Accetta lo stesso formato di
$wgBabelCategoryNames
. Per esempio:$wgBabelMainCategory = 'User %code%';
$wgBabelDefaultLevel
- ; $var : (stringa) Abilità linguistica assegnata di default quando null'altro è specificato, dovrebbe essere un indice tratto da
$wgBabelCategoryNames
, che corrisponde a una delle stringhe "1", "2", … "5", "N". Il valore di default è "N" cioè madrelingua. $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. $wgBabelCategoryOverride
- Whether to allow Babel categories to be overridden on wiki using MediaWiki:Babel-category-override
$wgBabelAutoCreate
- Whether to auto-create categories.
System messages
Diverse personalizzazioni possono anche essere effettuate usando i messaggi nel namespace MediaWiki.
- MediaWiki:babel-template "
Template:Utente $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
" - Nome utente da usare per la creazione automatica delle categorie Babel
- MediaWiki:babel-autocreate-text-levels "
Gli utenti in questa categoria indicano che riescono a comunicare in $2 con un livello di conoscenza $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 "
Gli utenti in questa categoria indicano il loro livello di conoscenza in $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 "
Babel utente
" - L'intestazione del box babel Set to
-
to not display a header. - MediaWiki:babel-url "
Project:Babel
" - The pagename where information on the babel extension can be found. Set to
-
to display no link in the header. - MediaWiki:Babel-footer "
Utenti per lingua
" - The footer of the babel box. Set to
-
to not display a footer. - MediaWiki:babel-footer-url "
:Category:Utenti per lingua
" - The page to link to in the footer of the babel box
- MediaWiki:Babel-category-override "
$1
" - Overrides any automatically-generated Babel categories. Parameters:
$1 = the category that would be generated normally.
$2 = the language code
$3 is the babel level.
Any categories overridden using this method will not be auto-created to reduce the risk from vandalism or mistaken edits to that page.
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]
Questa estensione viene utilizzata su uno o più progetti Wikimedia. Ciò probabilmente significa che l'estensione è stabile e funziona abbastanza bene da essere utilizzata da siti Web ad alto traffico. Cerca il nome di questa estensione nei file di configurazione CommonSettings.php e InitialiseSettings.php di Wikimedia per vedere dove è installato. Un elenco completo delle estensioni installate su un particolare wiki può essere visto sulla pagina Special:Version del wiki. |
This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |