From d367de86c787dd7159487abae04d5498968910c3 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Wed, 7 Sep 2022 11:39:03 +0900 Subject: [PATCH] feat: Add i18n_ulocale_get_display_country test Add i18n_ulocale_get_display_country test Change-Id: I19a4f537de5739651a2317274dac3cc32cd762c8 --- i18ninfo/i18ninfo.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/i18ninfo/i18ninfo.cpp b/i18ninfo/i18ninfo.cpp index be0080b..e40dd76 100644 --- a/i18ninfo/i18ninfo.cpp +++ b/i18ninfo/i18ninfo.cpp @@ -742,18 +742,24 @@ static int __get_language_info() /* Get the default locale code */ printf("| Default locale code | %s\n", default_locale); + /* Get the display country name of the selected locale. */ + i18n_uchar country[BUF_SIZE]; + + i18n_ulocale_get_display_country(default_locale, default_locale, country, BUF_SIZE); + char country_ch[BUF_SIZE +1]; + i18n_ustring_copy_au_n(country_ch, country, BUF_SIZE); + printf("| Country display name | %s\n", country_ch); + /* Get the display name of the selected locale. */ i18n_uchar name[BUF_SIZE]; int name_len; - int ret = - i18n_ulocale_get_display_name(default_locale, default_locale, name, BUF_SIZE, &name_len); + int ret = i18n_ulocale_get_display_name(default_locale, default_locale, name, BUF_SIZE, &name_len); CHECK_ERROR("i18n_ulocale_get_display_name", ret); char name_ch[BUF_SIZE +1]; i18n_ustring_copy_au_n(name_ch, name, BUF_SIZE); printf("| Language display name | %s\n", name_ch); - /* Get the language related to the selected locale. */ i18n_ulocale_get_display_language(default_locale, default_locale, lang, BUF_SIZE); -- 2.7.4