diff options
author | Daniel Black <daniel@mariadb.org> | 2023-02-09 18:41:45 +1100 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2023-02-15 22:39:38 +1100 |
commit | fab166532f3317c9d04c6f0be17babe7e0927e52 (patch) | |
tree | e8b8aaa9c8d82510358b7e9ef1f837ac26bd9ee5 | |
parent | 60f96b58e4b4d24708b63401ac12f1f058684ea7 (diff) | |
download | mariadb-git-fab166532f3317c9d04c6f0be17babe7e0927e52.tar.gz |
MDEV-30630 locale: Chinese error messages for ZH_CN
MDEV-28227 added the error messages in simplified characters.
Lets use these for those running a zh_CN profile.
From Haidong Ji in the MDEV, Taiwan/Hong Kong (zh_TW/zh_HK)
would expect traditional characters so this is left for when
we have these.
-rw-r--r-- | mysql-test/main/locale.result | 10 | ||||
-rw-r--r-- | mysql-test/main/locale.test | 14 | ||||
-rw-r--r-- | mysql-test/suite/plugins/r/locales.result | 4 | ||||
-rw-r--r-- | sql/sql_locale.cc | 5 |
4 files changed, 29 insertions, 4 deletions
diff --git a/mysql-test/main/locale.result b/mysql-test/main/locale.result index f136e9e99ab..8ff5bde39e1 100644 --- a/mysql-test/main/locale.result +++ b/mysql-test/main/locale.result @@ -306,3 +306,13 @@ date_format('2001-01-06', '%w %a %W', 'de_CH') select date_format('2001-09-01', '%c %b %M', 'de_CH'); date_format('2001-09-01', '%c %b %M', 'de_CH') 9 Sep September +# +# MDEV-30630 locale: Chinese error message for ZH_CN +# +SET lc_messages=ZH_CN; +SELECT x; +ERROR 42S22: 未知列'x'在'field list' +SET lc_messages=DEFAULT; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/locale.test b/mysql-test/main/locale.test index a9a507bc387..7d9a07178ee 100644 --- a/mysql-test/main/locale.test +++ b/mysql-test/main/locale.test @@ -181,3 +181,17 @@ select date_format('2001-10-01', '%c %b %M', 'rm_CH'); select date_format('2001-12-01', '%c %b %M', 'rm_CH'); select date_format('2001-01-06', '%w %a %W', 'de_CH'); select date_format('2001-09-01', '%c %b %M', 'de_CH'); + +--echo # +--echo # MDEV-30630 locale: Chinese error message for ZH_CN +--echo # + +SET lc_messages=ZH_CN; +--error ER_BAD_FIELD_ERROR +SELECT x; + +SET lc_messages=DEFAULT; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/suite/plugins/r/locales.result b/mysql-test/suite/plugins/r/locales.result index e906d27c21e..5229b7ffaa8 100644 --- a/mysql-test/suite/plugins/r/locales.result +++ b/mysql-test/suite/plugins/r/locales.result @@ -57,7 +57,7 @@ ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOU 53 uk_UA Ukrainian - Ukraine 8 9 , . ukrainian 54 ur_PK Urdu - Pakistan 6 6 . , english 55 vi_VN Vietnamese - Vietnam 16 11 , . english -56 zh_CN Chinese - Peoples Republic of China 3 3 . , english +56 zh_CN Chinese - Peoples Republic of China 3 3 . , chinese 57 zh_TW Chinese - Taiwan 3 2 . , english 58 ar_DZ Arabic - Algeria 6 8 . , english 59 ar_EG Arabic - Egypt 6 8 . , english @@ -170,7 +170,7 @@ Id Name Description Error_Message_Language 53 uk_UA Ukrainian - Ukraine ukrainian 54 ur_PK Urdu - Pakistan english 55 vi_VN Vietnamese - Vietnam english -56 zh_CN Chinese - Peoples Republic of China english +56 zh_CN Chinese - Peoples Republic of China chinese 57 zh_TW Chinese - Taiwan english 58 ar_DZ Arabic - Algeria english 59 ar_EG Arabic - Egypt english diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc index dd19807dd6d..60e7abc3fa2 100644 --- a/sql/sql_locale.cc +++ b/sql/sql_locale.cc @@ -29,7 +29,7 @@ enum err_msgs_index { - en_US= 0, cs_CZ, da_DK, nl_NL, et_EE, fr_FR, de_DE, el_GR, hu_HU, it_IT, + en_US= 0, zh_CN, cs_CZ, da_DK, nl_NL, et_EE, fr_FR, de_DE, el_GR, hu_HU, it_IT, ja_JP, ko_KR, no_NO, nn_NO, pl_PL, pt_PT, ro_RO, ru_RU, sr_RS, sk_SK, es_ES, sv_SE, uk_UA, hi_IN } ERR_MSGS_INDEX; @@ -38,6 +38,7 @@ enum err_msgs_index MY_LOCALE_ERRMSGS global_errmsgs[]= { {"english", NULL}, + {"chinese", NULL}, {"czech", NULL}, {"danish", NULL}, {"dutch", NULL}, @@ -2095,7 +2096,7 @@ MY_LOCALE my_locale_zh_CN '.', /* decimal point zh_CN */ ',', /* thousands_sep zh_CN */ "\x03", /* grouping zh_CN */ - &global_errmsgs[en_US] + &global_errmsgs[zh_CN] ); /***** LOCALE END zh_CN *****/ |