확장기능:바벨

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:Babel and the translation is 17% complete.

Other languages:
asturianu • ‎български • ‎català • ‎dansk • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎français • ‎हिन्दी • ‎magyar • ‎italiano • ‎日本語 • ‎한국어 • ‎조선말 • ‎Lëtzebuergesch • ‎lietuvių • ‎polski • ‎português • ‎português do Brasil • ‎русский • ‎sicilianu • ‎Scots • ‎中文
미디어위키 확장 기능 매뉴얼Manual:Extensions
Crystal Clear action run.svg
Babel

출시 상태:Extension status 안정

Babel-extension-screenshot.png
구현Template:Extension#type Parser extension
설명Template:Extension#description Adds a parser function to inform other users about language proficiency and categorize users of the same levels and languages.
만든이Template:Extension#username Robert Leverington (RobertLtalk)
최신 버전Template:Extension#version Continuous updates
MediaWikiTemplate:Extension#mediawiki 1.25+
데이터베이스 변경Template:Extension#needs-updatephp 아니오
ComposerComposer mediawiki/babel
라이선스Template:Extension#license GNU General Public License 2.0 or later
다운로드 언어 확장 번들을 포함한다.MLEB
예제Template:Extension#example Translatewiki.net
변수Template:Extension#parameters
  • $wgBabelCategorizeNamespaces
  • $wgBabelCategoryNames
  • $wgBabelMainCategory
  • $wgBabelDefaultLevel
  • $wgBabelUseUserLanguage
  • $wgBabelUseDatabase
  • $wgBabelCentralDb
  • $wgBabelCentralApi
사용된 훅Template:Extension#hook
ParserFirstCallInitManual:Hooks/ParserFirstCallInit
LinksUpdateManual:Hooks/LinksUpdate
LoadExtensionSchemaUpdatesManual:Hooks/LoadExtensionSchemaUpdates
UserGetReservedNamesManual:Hooks/UserGetReservedNames

Babel 확장 기능 번역 (translatewiki.net에서 가능한 경우)

사용법과 버전 매트릭스를 확인합니다.

이슈Phabricator

미해결 작업 · 버그 보고
경고 경고: The Babel extension is incompatible with the web updater. If you need to use the web updater in your wiki, disable this extension first from LocalSettings.php, run the web updater, and enable it again. 작업 T69877 참고.

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.

다운로드

The extension can be retrieved directly from Git [?]:

  • Browse code
  • Some extensions have tags for stable releases.
  • 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).

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/p/mediawiki/extensions/Babel.git

설치

  • 파일을 다운로드해서, extensions/ 폴더 내의 Babel 이라는 이름의 디렉터리 내에 설치합니다.
  • 아래의 코드를 LocalSettings.php의 말미에 추가합니다:
    wfLoadExtension( 'Babel' );
    
  • Configure as required.
  • YesY 완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.

미디어위키 1.25 이하를 실행 중인 사용자에게:

위의 지시사항은 wfLoadExtension()을 사용하여 이 확장기능을 설치하는 새로운 방법을 기술합니다 wfLoadExtension( 'Babel' ); 대신 이 초기 버전(미디어위키 1.25 이하)에 이 확장기능을 설치하려면 다음을 사용해야 합니다:

require_once "$IP/extensions/Babel/Babel.php";
  • 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.

사용법

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
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.
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, 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 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.
예를 들어:
$wgBabelCategoryNames = array(
	'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.

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 "⧼babel-portal⧽"
The format of the target of the link from the language code.
MediaWiki:Babel-autocreate-user "바벨 자동만듦"
Username to be used for autocreation 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
MediaWiki:babel-url "Project:바벨"
The pagename where information on the babel extension can be found
MediaWiki:Babel-footer "언어별 사용자"
The footer of the babel box
MediaWiki:babel-footer-url " :분류:언어별 사용자"
The page to link to in the footer of the babel box

API

meta=babel (bab)

(main | query | babel)

Get information about what languages the user knows

Parameter:
babuser

User to get information about

This parameter is required.
Type: user name
Example:
Get the Babel information for user Example
api.php?action=query&meta=babel&babuser=Example [open in sandbox]