Unicode extensions
Following extensions are supported:
- ca-extension
- Specifies the preferred calendar in the staticChronoFormatter
-methodsofGenericCalendarStyle()
,ofGenericCalendarPattern()
andofGenericMomentPattern()
.
- Illustrating example:
Locale loc = Locale.forLanguageTag("de-u-ca-persian"); ChronoFormatter<CalendarDate> f = ChronoFormatter.ofGenericCalendarStyle(DisplayMode.MEDIUM, loc); System.out.println(f.format(SystemClock.inLocalView().today())); // example output: AP 1393 Farwardin 10, Sonntag
- nu-extension
- Determines the number system to be used in formatting numerals.
- Example expression for setting Thai numerals:
Locale loc = Locale.forLanguageTag("th-TH-u-nu-" + NumberSystem.THAI.getCode()); ChronoFormatter<PlainDate> f = ChronoFormatter.ofDatePattern("MM/dd/yyyy", PatternType.CLDR, loc); System.out.println(f.format(SystemClock.inLocalView().today())); // example output: ๑๑/๒๐/๒๐๑๘
- fw-extension
- Specifies the first day of week.
- Illustrating example:
Locale locale = Locale.forLanguageTag("en-US-u-fw-mon"); assertThat(Weekmodel.of(locale), is(Weekmodel.of(Weekday.MONDAY, 1)));
- hc-extension
- Overrides the locale-specific hour cycle with the possible values h11, h12, h23 and h24.
- Illustrating example:
Moment m = Moment.UNIX_EPOCH.plus(14, TimeUnit.HOURS); Locale locale = Locale.forLanguageTag("de-DE-u-hc-h12"); TZID berlin = () -> "Europe/Berlin"; assertThat( ChronoFormatter.ofMomentStyle( FormatStyle.FULL, FormatStyle.FULL, locale, berlin).print(m), is("Donnerstag, 1. Januar 1970 um 3:00:00 nachm. Mitteleuropäische Zeit"));
- rg-extension
- Specifies the region or country consisting of 6 characters which start with the ISO-3166-code and end with ZZZZ.
- Illustrating example:Locale.forLanguageTag("en-u-rg-USZZZZ")
is an alternative forLocale.US
.
Supported ISO-639-codes
Following 95 language codes have extended support in Time4J-v5.9.1 beyond the capabilities of standard Java:
Code | Language (English) | Language (native) | Remark |
---|---|---|---|
af | Afrikaans | Afrikaans | |
am | Amharic | አማርኛ | |
ar | Arabic | العربية | |
as | Assamese | অসমীয়া | |
ast | Asturian | Asturianu | ISO-639-2 |
az | Azerbaijani | azərbaycan dili | |
be | Belarusian | беларуская мова | |
bg | Bulgarian | български език | |
bn | Bengali | বাংলা | |
br | Breton | brezhoneg | |
bs | Bosnian | bosanski jezik | |
ca | Catalan | català | alias: Valencian |
cs | Czech | čeština | |
cy | Welsh | Cymraeg | |
da | Danish | dansk | |
de | German | Deutsch | |
ee | Ewe | Eʋegbe | |
el | Greek | ελληνικά | modern |
en | English | English | |
eo | Esperanto | Esperanto | constructed |
es | Spanish | Español | |
et | Estonian | eesti | |
eu | Basque | euskara | |
fa | Persian | فارسی | alias: Farsi |
fi | Finnish | suomi | |
fil | Filipino | Wikang Filipino | alias: Tagalog (tl), ISO-639-2 |
fo | Faroese | føroyskt | |
fr | French | française | |
fy | Frisian | Frysk | western |
ga | Irish | Gaeilge | |
gd | Gaelic | Gàidhlig | alias: Scottish |
gl | Galician | Galego | |
gsw | Swiss German | Schwyzerdütsch | |
gu | Gujarati | ગુજરાતી | |
he | Hebrew | עברית | alias: Hebrew (iw) |
hi | Hindi | हिन्दी, हिंदी | |
hr | Croatian | hrvatski jezik | |
hu | Hungarian | magyar | |
hy | Armenian | Հայերեն | |
id | Indonesian | Bahasa Indonesia | alias: Indonesian (in) |
in | Indonesian | old code (use: id) | |
is | Icelandic | Íslenska | |
it | Italian | Italiano | |
iw | Hebrew | old code (use: he) | |
ja | Japanese | 日本語 (にほんご) | |
ka | Georgian | ქართული | |
kab | Kabyle | Tamaziɣt Taqbaylit | ISO-639-2 |
kk | Kazakh | қазақ тілі | |
km | Khmer | ខ្មែរ | alias: Cambodian |
kn | Kannada | ಕನ್ನಡ | |
ko | Korean | 한국어 | |
ku *) | Kurdish | Kurdî | macro language |
ky | Kirghiz | Кыргызча | |
lb | Luxembourgish | Lëtzebuergesch | |
lo | Lao | ພາສາລາວ | |
lt | Lithuanian | lietuvių kalba | |
lv | Latvian | latviešu valoda | |
mk | Macedonian | македонски јазик | |
ml | Malayalam | മലയാളം | |
mn | Mongolian | Монгол хэл | |
mr | Marathi | मराठी | |
ms | Malay | Bahasa Melayu | |
mt **) | Maltese | Malti | |
my | Burmese | ဗမာစာ | |
nb | Norwegian Bokmål | Norsk Bokmål | alias: Norwegian (no) |
ne | Nepali | नेपाली | |
nl | Dutch | Nederlands | |
nn | Norwegian Nynorsk | Norsk Nynorsk | |
no | Norwegian | Norsk | alias: Norwegian Bokmål (nb) |
or | Oriya | ଓଡ଼ିଆ | alias: Odia |
pa | Panjabi | ਪੰਜਾਬੀ | alias: Punjabi |
pl | Polish | język polski | |
ps ***) | Pashto | پښتو | |
pt | Portuguese | Português | |
ro | Romanian | Română | similar: Moldavian |
ru | Russian | русский | |
sd | Sindhi | सिन्धी | |
si | Sinhala | සිංහල | alias: Sinhalese |
sk | Slovak | Slovenčina | |
sl | Slovene | Slovenski Jezik | alias: Slovenian |
so | Somali | Soomaali | |
sq | Albanian | Shqip | |
sr | Serbian | српски језик | |
sv | Swedish | Svenska | |
sw | Swahili | Kiswahili | |
ta | Tamil | தமிழ் | |
te | Telugu | తెలుగు | |
th | Thai | ไทย | |
tk | Turkmen | Türkmen | |
tl | Tagalog | Wikang Tagalog | alias: Filipino (fil) |
to | Tongan | Faka Tonga | |
tr | Turkish | Türkçe | |
ug | Uighur | ئۇيغۇرچە | |
uk | Ukrainian | Українська | |
ur | Urdu | اردو | |
uz | Uzbek | Oʻzbek | |
vi | Vietnamese | Tiếng Việt | |
zh | Chinese | 中文 | |
zu | Zulu | isiZulu |
*) No support for formatting relative durations
**) No support for formatting absolute durations
***) No support for formatting durations (neither relative nor absolute)