⛏️ index : haiku.git

author Adrien Destugues <pulkomandy@pulkomandy.ath.cx> 2010-04-15 14:57:39.0 +00:00:00
committer Adrien Destugues <pulkomandy@pulkomandy.ath.cx> 2010-04-15 14:57:39.0 +00:00:00
commit
e6769b02cead1dffeba4b93e98693e15cf71a63b [patch]
tree
a7773fc90367736baf7de91149332736cb96404e
parent
c25c05da25f442fa8d30083d508d8e025ffea0f9
download
e6769b02cead1dffeba4b93e98693e15cf71a63b.tar.gz

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

Diff

 src/kits/locale/Language.cpp     | 15 +++++++++++++--
 src/kits/locale/LocaleRoster.cpp |  6 ++----
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/kits/locale/Language.cpp b/src/kits/locale/Language.cpp
index fec6931..5603d59 100644
--- a/src/kits/locale/Language.cpp
+++ b/src/kits/locale/Language.cpp
@@ -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 @@
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;
diff --git a/src/kits/locale/LocaleRoster.cpp b/src/kits/locale/LocaleRoster.cpp
index 2de9e22..b332692 100644
--- a/src/kits/locale/LocaleRoster.cpp
+++ b/src/kits/locale/LocaleRoster.cpp
@@ -182,10 +182,8 @@
	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 @@
			// 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;