From: DongHun Kwak Date: Wed, 7 Sep 2022 02:39:03 +0000 (+0900) Subject: feat: Add i18n_ulocale_get_display_country test X-Git-Tag: accepted/tizen/unified/20230206.093745~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F280937%2F1;p=platform%2Fcore%2Fapi%2Fbase-utils.git feat: Add i18n_ulocale_get_display_country test Add i18n_ulocale_get_display_country test Change-Id: I19a4f537de5739651a2317274dac3cc32cd762c8 --- 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);