Server Locale

The lc_time_names server system variable sets the language used by the date and time functions DAYNAME(), MONTHNAME() and DATE_FORMAT() and lc_messages sets the language for error messages.

The list of the locales supported by the current MariaDB installation can be obtained via the LOCALES plugin.

MariaDB supports the following locale values:

LocaleLanguageTerritory
ar_AEArabicUnited Arab Emirates
ar_BHArabicBahrain
ar_DZArabicAlgeria
ar_EGArabicEgypt
ar_INArabicIran
ar_IQArabicIraq
ar_JOArabicJordan
ar_KWArabicKuwait
ar_LBArabicLebanon
ar_LYArabicLibya
ar_MAArabicMorocco
ar_OMArabicOman
ar_QAArabicQatar
ar_SAArabicSaudi Arabia
ar_SDArabicSudan
ar_SYArabicSyria
ar_TNArabicTunisia
ar_YEArabicYemen
be_BYBelarusianBelarus
bg_BGBulgarianBulgaria
ca_ESCatalanCatalan
cs_CZCzechCzech Republic
da_DKDanishDenmark
de_ATGermanAustria
de_BEGermanBelgium
de_CHGermanSwitzerland
de_DEGermanGermany
de_LUGermanLuxembourg
el_GRGreekGreece
en_AUEnglishAustralia
en_CAEnglishCanada
en_GBEnglishUnited Kingdom
en_INEnglishIndia
en_NZEnglishNew Zealand
en_PHEnglishPhilippines
en_USEnglishUnited States
en_ZAEnglishSouth Africa
en_ZWEnglishZimbabwe
es_ARSpanishArgentina
es_BOSpanishBolivia
es_CLSpanishChile
es_COSpanishColumbia
es_CRSpanishCosta Rica
es_DOSpanishDominican Republic
es_ECSpanishEcuador
es_ESSpanishSpain
es_GTSpanishGuatemala
es_HNSpanishHonduras
es_MXSpanishMexico
es_NISpanishNicaragua
es_PASpanishPanama
es_PESpanishPeru
es_PRSpanishPuerto Rico
es_PYSpanishParaguay
es_SVSpanishEl Salvador
es_USSpanishUnited States
es_UYSpanishUruguay
es_VESpanishVenezuela
et_EEEstonianEstonia
eu_ESBasqueBasque
fi_FIFinnishFinland
fo_FOFaroeseFaroe Islands
fr_BEFrenchBelgium
fr_CAFrenchCanada
fr_CHFrenchSwitzerland
fr_FRFrenchFrance
fr_LUFrenchLuxembourg
gl_ESGalicianGalician
gu_INGujaratiIndia
he_ILHebrewIsrael
hi_INHindiIndia
hr_HRCroatianCroatia
hu_HUHungarianHungary
id_IDIndonesianIndonesia
is_ISIcelandicIceland
it_CHItalianSwitzerland
it_ITItalianItaly
ja_JPJapaneseJapan
ka_GEGeorgianGeorgia (From MariaDB 10.11.3)
ko_KRKoreanRepublic of Korea
lt_LTLithuanianLithuania
lv_LVLatvianLatvia
mk_MKMacedonianFYROM
mn_MNMongoliaMongolian
ms_MYMalayMalaysia
nb_NONorwegian(Bokmål)Norway
nl_BEDutchBelgium
nl_NLDutchThe Netherlands
no_NONorwegianNorway
pl_PLPolishPoland
pt_BRPortugeseBrazil
pt_PTPortugesePortugal
rm_CHRomanshSwitzerland
ro_RORomanianRomania
ru_RURussianRussia
ru_UARussianUkraine
sk_SKSlovakSlovakia
sl_SISlovenianSlovenia
sq_ALAlbanianAlbania
sr_YUSerbianSerbia (Deprecated in MariaDB 10.0.11 and removed in MariaDB 10.3.0)
sv_FISwedishFinland
sv_SESwedishSweden
sw_KESwahiliKenya (from MariaDB 11.1.2)
ta_INTamilIndia
te_INTeluguIndia
th_THThaiThailand
tr_TRTurkishTurkey
uk_UAUkrainianUkraine
ur_PKUrduPakistan
vi_VNVietnameseViet Nam
zh_CNChineseChina
zh_HKChineseHong Kong
zh_TWChineseTaiwan Province of China

Examples

Setting the lc_time_names and lc_messages variables to localize the units of date and time, and the server error messages.

SELECT DAYNAME('2013-04-01'), MONTHNAME('2013-04-01');
+-----------------------+-------------------------+
| DAYNAME('2013-04-01') | MONTHNAME('2013-04-01') |
+-----------------------+-------------------------+
| Monday                | April                   |
+-----------------------+-------------------------+

SET lc_time_names = 'fr_CA';

SELECT DAYNAME('2013-04-01'), MONTHNAME('2013-04-01');
+-----------------------+-------------------------+
| DAYNAME('2013-04-01') | MONTHNAME('2013-04-01') |
+-----------------------+-------------------------+
| lundi                 | avril                   |
+-----------------------+-------------------------+

SELECT blah;
ERROR 1054 (42S22): Unknown column 'blah' in 'field' list'

SET lc_messages = 'nl_NL';

SELECT blah;
ERROR 1054 (42S22): Onbekende kolom 'blah' in field list

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.