Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7446746
README.md
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
978 B
Referenced Files
None
Subscribers
None
README.md
View Options
#
mediawiki
/
extensions
/
cldr
This
extension
extracts
a
subset
of
core
CLDR
data
and
makes
it
available
to
PHP
.
Currently
,
it
provides
the
following
:
-
Country
names
-
Currency
names
and
symbols
-
Language
names
-
Units
of
time
##
Installation
Clone
the
source
to
MediaWiki
`
extensions
/
`
and
enable
it
in
`
LocalSettings
.
php
`
:
wfLoadExtension
(
'
cldr
'
);
##
Updating
data
Look
up
the
latest
release
of
[
CLDR
](
https
:
//www.unicode.org/cldr/repository_access.html) and note the version number.
Update
the
version
number
in
`
CLDR_CORE_URL
`
in
`
Makefile
`
.
Run
`
make
`
:
make
all
##
Example
usage
```
php
if
(
ExtensionRegistry
::
isLoaded
(
'
cldr
'
)
)
{
// Get the English translation of all available language names.
$
languages
=
LanguageNames
::
getNames
(
'
en
'
,
LanguageNames
::
FALLBACK_NATIVE
,
LanguageNames
::
LIST_MW_AND_CLDR
);
}
else
{
// Fall back to the MediaWiki core function without CLDR.
$
languages
=
Language
::
getLanguageNames
(
false
);
}
```
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 18:49 (1 d, 10 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c3/15/13a77b250e1f845c0e075d45f8e4
Default Alt Text
README.md (978 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment