Extension:CLDR/pl
CLDR Status wydania: stabilne |
|
---|---|
File:ExampleOfCLDRExtension.png | |
Realizacja | Funkcja parsera |
Opis | Provides functions to localize the names of languages, countries, currencies, and time units based on their language code. |
Autor(zy) |
|
MediaWiki | 1.30+ |
Zmiany w bazie danych | Nie |
Composer | mediawiki/cldr |
Licencja | GPL-2.0-or-later, data variant of BSD 3-clauses |
Pobieranie | Included in Language Extension Bundle or
README |
Przykład | Translatewiki.net |
master | |
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Przetłumacz rozszerzenie CLDR jeżeli jest dostępne na 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.
Installation
- <translate> [[<tvar name=2>Special:ExtensionDistributor/cldr</tvar>|Download]] and move the extracted <tvar name=name>
cldr
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/cldr - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'cldr' );
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
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 http://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' );
}
Zobacz też
File:Wikimedia-logo black.svg | <translate> This {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is being used on one or more [[<tvar name=2>m:Special:MyLanguage/Wikimedia projects</tvar>|Wikimedia projects]].</translate> <translate> This probably means that the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is stable and works well enough to be used by such high-traffic websites.</translate> <translate> Look for this {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension's|skin's}} name in Wikimedia's <tvar name=2>CommonSettings.php</tvar> and <tvar name=3>InitialiseSettings.php</tvar> configuration files to see where it's installed.</translate> <translate> A full list of the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extensions|skins}} installed on a particular wiki can be seen on the wiki's <tvar name=ver>Special:Version</tvar> page.</translate> |
ExampleOfCLDRExtension.png |
- Pages with script errors
- Pages with broken file links
- Stable extensions/pl
- Parser function extensions/pl
- Extensions with manual MediaWiki version
- Extensions supporting Composer/pl
- Extensions with unknown license/pl
- Extensions in Wikimedia version control/pl
- All extensions/pl
- Extensions not in ExtensionJson
- Extensions used on Wikimedia/pl
- Localisation extensions/pl