Fix Language::GetName using the system-wide language settings instead of the current application one. Make ReadOnlyBootPrompt localize the list instantly when you select a language in it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36295 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2010-04-15 14:57:39 +00:00
parent c25c05da25
commit e6769b02ce
2 changed files with 14 additions and 7 deletions
+12 -3
View File
@@ -8,6 +8,9 @@
#include <iostream>
#include <Catalog.h>
#include <Locale.h>
#include <LocaleRoster.h>
#include <Path.h>
#include <String.h>
#include <FindDirectory.h>
@@ -133,10 +136,16 @@ 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.
BMessage preferredLanguage;
be_locale_roster->GetPreferredLanguages(&preferredLanguage);
BString appLanguage;
preferredLanguage.FindString("language", 0, &appLanguage);
printf("lang : %s\n",appLanguage.String());
UnicodeString s;
fICULocale->getDisplayName(s);
fICULocale->getDisplayName(Locale(appLanguage), s);
BStringByteSink converter(name);
s.toUTF8(converter);
return B_OK;
+2 -4
View File
@@ -182,10 +182,8 @@ RosterData::RosterData()
BAutolock lock(fLock);
assert(lock.IsLocked());
// TODO: make a decision about log-facility and -options
openlog_team("liblocale.so", LOG_PID, LOG_USER);
#ifndef DEBUG
// TODO: find out why the following bugger isn't working!
setlogmask_team(LOG_UPTO(LOG_WARNING));
#endif
@@ -650,9 +648,9 @@ BLocaleRoster::LoadCatalog(const char *signature, const char *language,
// other languages.
// The current implementation uses the filename in order to
// detect dependencies (parenthood) between languages (it
// traverses from "english-british-oxford" to "english-british"
// traverses from "english_british_oxford" to "english_british"
// to "english"):
// TODO :use ICU facilities instead, so we can handle more
// TODO: use ICU facilities instead, so we can handle more
// complex things such as fr_FR@euro, or whatever, encodings
// and so on.
int32 pos;