Jump to content

တိုးချဲ့မှု- Babel

From mediawiki.org
This page is a translated version of the page Extension:Babel and the translation is 19% complete.
MediaWiki extensions manual
Babel
Release status: stable
Implementation Parser function
Description ဘာသာစကားကျွမ်းကျင်မှုအကြောင်း အခြားအသုံးပြုသူများအား အသိပေးရန်နှင့် တူညီသောအဆင့်များနှင့် ဘာသာစကားများကို အသုံးပြုသူများကို အမျိုးအစားခွဲရန် parser လုပ်ဆောင်ချက် တစ်ခုထပ်ထည့်သည်။
Author(s) Robert Leverington (RobertLဆွေးနွေး)
Latest version ဆက်တိုက်မွမ်းမံမှုများ
Compatibility policy Master maintains backward compatibility.
MediaWiki >= 1.41.0
Database changes Yes
Composer mediawiki/babel
Tables babel
License GNU General Public License 2.0 or later
Download ဘာသာစကားတွင် တိုးချဲ့မှုအစုအဝေးတွင် ပါဝင်သည်။
Example Translatewiki.net
  • $wgBabelMainCategory
  • $wgBabelAutoCreate
  • $wgBabelDefaultLevel
  • $wgBabelCategorizeNamespaces
  • $wgBabelUseUserLanguage
  • $wgBabelCentralDb
  • $wgBabelCategoryNames
  • $wgBabelUseCommunityConfiguration
  • $wgBabelAllowOverride
Quarterly downloads 65 (Ranked 71st)
Public wikis using 2,416 (Ranked 192nd)
Translate the Babel extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

ဘေဘယ် တိုးချဲ့မှု့ သည် ပုံစံများကို လုံးဝမှီခိုအားထားရသော အဟောင်း ဘေဘယ် စနစ်အား အစားထိုးရန် parser function ကို ပေါင်းထည့်သည်။ အကယ်၍ အသိအမှတ်မပြုသော ဘာသာစကား ကန့်သတ်ချက်တစ်ခုကို သတ်မှတ်ပါက၊ ၎င်းတွင် အမည်ပါရှိပြီးသား နမူနာပုံစံတစ်ခု ရှိမရှိကို ၎င်းတွင် တွေ့ရမည်ဖြစ်သည်။

Wikimedia ပရောဂျက်များတွင် နာမ် Babel (Tower of Babel|Tower of Babel ကိုရည်ညွှန်း၍) သည် တစ်စုံတစ်ဦးကို ဆက်သွယ်ရလွယ်ကူစေခြင်းဖြင့် ဘာသာစကားမျိုးစုံဆက်သွယ်မှုကို အထောက်အကူဖြစ်စေသော အသုံးပြုသူစာမျက်နှာများရှိ စာသားများကို ရည်ညွှန်းပါသည်။ ဘာသာစကားတစ်ခုခုကို ပြောတတ်သူ။ အိုင်ဒီယာကို Wikimedia Commons မှ အစပြုခဲ့ပြီး အခြားသော ဝီကီများစွာတွင်လည်း အကောင်အထည်ဖော်ခဲ့သည်။

တပ်ဆင်ခြင်း

  • Download and move the extracted Babel folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Babel
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Babel' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • လိုအပ်သလို ပြင်ဆင်ပါ။
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
  • The CSS is located in the file resources/ext.babel.css. You can change the style as desired by overriding them in the page MediaWiki: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.

Usage

Syntax for the #babel parser function is as follows:

{{#babel: babelcode1 | babelcode2 | ... }}

သင်ပြောသော သို့မဟုတ် နားလည်သည့်ဘာသာစကားတစ်ခုစီအတွက် အောက်ပါကုဒ်များထဲမှ တစ်ခုကို | ဖြင့် ပိုင်းခြား၍ xx သည် MediaWiki ဘာသာစကားကုဒ်ISO 639-1 ကုဒ် သို့မဟုတ် ဘာသာစကားအတွက် ISO 639-3 ကုဒ်။ ကုဒ်အဆင့်တစ်ခုစီ၏ ယေဘူယျအသုံးပြုမှုမှာ အောက်ပါအတိုင်းဖြစ်သည်။

xx-0- ဘာသာစကား လုံးဝ နားမလည်ရင်။
xx-1- အခြေခံစွမ်းရည်—ဤဘာသာစကားဖြင့် ရေးသားထားသော အကြောင်းအရာ သို့မဟုတ် ရိုးရှင်းသောမေးခွန်းများကို နားလည်ရန်လုံလောက်သည်။
xx-2- အလယ်အလတ်စွမ်းရည်—တည်းဖြတ်ရန် သို့မဟုတ် ဆွေးနွေးမှုများအတွက် လုံလောက်သည်။
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.
xx-5: Professional proficiency.
xx or xx-N: Native speakers who use a language every day and have a thorough grasp of it, including colloquialisms and idioms.

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.

Parameters

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.

Categorization

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:

  1. Create a template {{Babel category }} that will generate categories.
  2. Replacing text on MediaWiki:babel-autocreate-text-levels with
    {{Babel category|level=$1|language=$2|ISO=$3}}
    
  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.

Configuration

Configuration parameters

Babel has several 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.
For example:
$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 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.

System messages

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 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 "ဤအမျိုးအစားမှ အသုံးပြုသူများသည် $2 ဘာသာအတွက် ကျွမ်းကျင်မှုအဆင့် $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 "ဤကဏ္ဍမှ အသုံးပြုသူများသည် $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 "အသုံးပြုသူ၏ ဘေဘယ်ပေါ်မှ သတင်းအချက်အလက်"
The header of the babel box. Set to - to not display a header.
MediaWiki:babel-url "Project:ဘေဘယ်"
The page name where information on the babel extension can be found. Set to - to display no link in the header.
MediaWiki:Babel-footer "ဘာသာစကားအလိုက် အသုံးပြုသူများ"
The footer of the babel box. Set to - to not display a footer.
MediaWiki:babel-footer-url " :Category:Babel - Users by language"
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 = the babel level.
Any categories overridden using this method will not be auto-created to reduce the risk of vandalism or mistaken edits to that page.

API

meta=babel (bab)

(main | query | babel)

Get information about what languages the user knows

Specific parameter:
Other general parameters are available.
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")
Example:
Get the Babel information for user Example
api.php?action=query&meta=babel&babuser=Example [open in sandbox]