diff --git a/src/kits/locale/Catalog.cpp b/src/kits/locale/Catalog.cpp index 6873cd379c..e93d59cf62 100644 --- a/src/kits/locale/Catalog.cpp +++ b/src/kits/locale/Catalog.cpp @@ -121,6 +121,10 @@ BCatalog::GetAppCatalog(BCatalog* catalog) appNode.ReadAttr(BLocaleRoster::kCatFingerprintAttr, B_UINT32_TYPE, 0, &fingerprint, sizeof(uint32)); // try to load catalog (with given fingerprint): + // TODO: Not so nice C++ design here, leading to such bugs: The previous + // fCatalog is leaked here. (The whole chain, it looks like.) There should + // be a SetCatalog() method (it can be private), and that should take care + // that internal members are always properly maintained. catalog->fCatalog = be_locale_roster->LoadCatalog(sig.String(), NULL, fingerprint); diff --git a/src/kits/locale/Language.cpp b/src/kits/locale/Language.cpp index 0c31758eb2..8ac5661b7f 100644 --- a/src/kits/locale/Language.cpp +++ b/src/kits/locale/Language.cpp @@ -132,6 +132,8 @@ BLanguage::GetString(uint32 id) const status_t BLanguage::GetName(BString* name) { + // TODO: This will return the language not in the current be_app_catalog, + // but in the current system wide language! Don't know the exact reason. UnicodeString s; fICULocale->getDisplayLanguage(s); BStringByteSink converter(name); diff --git a/src/kits/locale/Locale.cpp b/src/kits/locale/Locale.cpp index 8bb18f265e..1ad2bf59ab 100644 --- a/src/kits/locale/Locale.cpp +++ b/src/kits/locale/Locale.cpp @@ -45,9 +45,12 @@ BLocale::GetString(uint32 id) } status_t -BLocale::GetAppCatalog(BCatalog *catalog) { +BLocale::GetAppCatalog(BCatalog *catalog) +{ if (!catalog) return B_BAD_VALUE; + // TODO: This is not so nice, and I don't know why it is here, but how + // is it envisioned to switch languages on the fly? if (be_catalog) debugger( "GetAppCatalog() has been called while be_catalog != NULL"); return BCatalog::GetAppCatalog(catalog); diff --git a/src/kits/locale/LocaleRoster.cpp b/src/kits/locale/LocaleRoster.cpp index 1d1291ca8a..69abd879ab 100644 --- a/src/kits/locale/LocaleRoster.cpp +++ b/src/kits/locale/LocaleRoster.cpp @@ -513,6 +513,8 @@ BLocaleRoster::GetInstalledLanguages(BMessage *languages) const #undef REALLY_ALL_LANGUAGES #ifdef REALLY_ALL_LANGUAGES + // TODO: Using static variables here looks really weird, and is probably + // the reason why calling this method a second time will crash. static const char* const* icuLocaleList = Locale::getISOLanguages(); // Loop over the strings and add them to an std::set to remove duplicates