diff --git a/headers/os/locale/Country.h b/headers/os/locale/Country.h index 0d36873b92..c26906257d 100644 --- a/headers/os/locale/Country.h +++ b/headers/os/locale/Country.h @@ -49,7 +49,6 @@ public: ~BCountry(); bool GetName(BString& name) const; - bool GetLocaleName(BString& name) const; const char* Code() const; status_t GetIcon(BBitmap* result) const; diff --git a/headers/os/locale/Locale.h b/headers/os/locale/Locale.h index 52069b0729..fc978ccecc 100644 --- a/headers/os/locale/Locale.h +++ b/headers/os/locale/Locale.h @@ -27,6 +27,7 @@ public: const BCountry* Country() const { return &fCountry; } const BLanguage* Language() const { return &fLanguage; } const char* Code() const; + bool GetName(BString& name) const; void SetCountry(const BCountry& newCountry); void SetCollator(const BCollator& newCollator); diff --git a/src/kits/locale/Country.cpp b/src/kits/locale/Country.cpp index e7612d10b7..01fcf19909 100644 --- a/src/kits/locale/Country.cpp +++ b/src/kits/locale/Country.cpp @@ -79,17 +79,6 @@ BCountry::GetName(BString& name) const } -bool -BCountry::GetLocaleName(BString& name) const -{ - UnicodeString uString; - fICULocale->getDisplayName(uString); - BStringByteSink stringConverter(&name); - uString.toUTF8(stringConverter); - return true; -} - - const char* BCountry::Code() const { diff --git a/src/kits/locale/Locale.cpp b/src/kits/locale/Locale.cpp index 98c74e879f..9948d14390 100644 --- a/src/kits/locale/Locale.cpp +++ b/src/kits/locale/Locale.cpp @@ -125,6 +125,16 @@ BLocale::Code() const } +bool +BLocale::GetName(BString& name) const +{ + UnicodeString uString; + fICULocale->getDisplayName(uString); + BStringByteSink stringConverter(&name); + uString.toUTF8(stringConverter); + return true; +} + // #pragma mark - Date diff --git a/src/preferences/locale/LocaleWindow.cpp b/src/preferences/locale/LocaleWindow.cpp index c19b889fef..fa5e08c47d 100644 --- a/src/preferences/locale/LocaleWindow.cpp +++ b/src/preferences/locale/LocaleWindow.cpp @@ -190,10 +190,10 @@ LocaleWindow::LocaleWindow() LanguageListItem* currentItem = NULL; for (int i = 0; countryList.FindString("langs", i, &countryCode) == B_OK; i++) { - BCountry country(countryCode); + BLocale locale(countryCode); BString countryName; - country.GetLocaleName(countryName); + locale.GetName(countryName); LanguageListItem* item = new LanguageListItem(countryName, countryCode,