Extension:CLDR/ko
출시 상태: 안정 |
|
|---|---|
| 구현 | Locale |
| 설명 | Provides functions to localize the names of languages, countries, currencies, and time units based on their language code. |
| 만든 이 |
|
| 최신 버전 | 4.17.0 (Continous updates) |
| 호환성 정책 | Master maintains backward compatibility. |
| MediaWiki | 1.30+ |
| 데이터베이스 변경 | 아니오 |
| Composer | mediawiki/cldr |
| 다운로드 | Included in Language Extension Bundle or
README |
| 예시 | Translatewiki.net |
| CLDR 확장 기능 번역 (translatewiki.net에서 가능한 경우) | |
The CLDR extension contains local language names for different languages, countries, currencies, and time units extracted from CLDR data. See translatewiki:CLDR for information.
설치
- 파일을 다운로드하고
cldr폴더를extensions/디렉토리에 넣어 주세요.
개발자와 코딩 기여자는 Git을 이용해 확장기능을 다운받는 것이 좋습니다.cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/cldr
- 아래의 코드를 LocalSettings.php 코드의 마지막에 추가합니다.
wfLoadExtension( 'cldr' );
완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.
If you download from git, change the file from CLDR to cldr.
Updating data
The CLDR extension comes with data pre-populated in the language files, but if you want to get the latest data from the Unicode Consortium, you'll need to download it from the CLDR site and then run a rebuild script.
Download newest data from CLDR site:
http://www.unicode.org/cldr/repository_access.html
Example (from within the cldr directory):
wget https://www.unicode.org/Public/cldr/latest/core.zip
unzip core.zip -d core
php rebuild.php
Usage and parameters
Language names
CLDR defines the class LanguageNames which has a static method, getNames().
LanguageNames::getNames accepts three parameters:
- code – the ISO 639 (see Manual:Language#Language code for details) code of the preferred language to return the list in
- fbMethod – fallback method, it should be set to one of the following:
- LanguageNames::FALLBACK_NATIVE – Missing entries fallback to the native name (default)
- LanguageNames::FALLBACK_NORMAL – Missing entries fallback through the fallback chain
- list – which languages to return. Should be set to one of the following:
- LanguageNames::LIST_MW_SUPPORTED – Only languages that have localization in MediaWiki
- LanguageNames::LIST_MW – All languages that are in
Names.php(default) - LanguageNames::LIST_MW_AND_CLDR – All languages that are either in MediaWiki or in CLDR
Example
The language names are best access with MediaWiki core functions:
// Japanisch
$name = Language::fetchLanguageName( 'ja', 'de', 'all' );
Country names
CLDR defines the class CountryNames which has a static method, getNames().
CountryNames::getNames accepts one parameter:
- code - the ISO 639 code of the preferred language to return the list in
Example
The following example sets a variable to the list of all countries in CLDR in French.
if ( is_callable( array( 'CountryNames', 'getNames' ) ) ) {
$countries = CountryNames::getNames( 'fr' );
}
See also
| 이 확장 기능은 하나 이상의 위키미디어 프로젝트에서 사용 중입니다. 이것은 아마도 이 확장 기능이 안정적이고 트래픽이 많은 웹 사이트에서 사용할 수 있을 만큼 충분히 잘 작동한다는 것을 의미합니다. 설치된 위치를 확인하려면 위키미디어의 CommonSettings.php 및 InitialiseSettings.php 구성 파일에서 이 확장 기능의 이름을 찾습니다. 특정 위키에 설치된 확장 기능의 전체 목록은 위키의 Special:Version 문서에서 볼 수 있습니다. |
| This extension is included in the following wiki farms/hosts and/or packages: |
- Stable extensions/ko
- Internationalization extensions/ko
- Extensions supporting Composer/ko
- GetHumanTimestamp extensions/ko
- LanguageGetTranslatedLanguageNames extensions/ko
- GPL licensed extensions/ko
- Unicode licensed extensions/ko
- Extensions in Wikimedia version control/ko
- All extensions/ko
- Extensions used on Wikimedia/ko
- Extensions included in Canasta/ko
- Extensions included in Fandom/ko
- Extensions included in Miraheze/ko
- Extensions included in ProWiki/ko
- Extensions included in wiki.gg/ko
