- Locale kit : made the language class live. It now uses ICU as a backend as expected
- Some changes in the locale roster to allow instanciating a language - Locale preflet : use this new API instead of directly calling ICU Side effect : all languages in Locale window are now displayed in the current locale. It makes more sense as otherwise the list would be unsortable. However it can get annoying if you mistakenly set a strange language as default. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35210 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -8,10 +8,18 @@
|
||||
#define _LANGUAGE_H_
|
||||
|
||||
|
||||
#include <String.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <LocaleStrings.h>
|
||||
|
||||
|
||||
// We must not include the icu headers in there as it could mess up binary
|
||||
// compatibility.
|
||||
namespace icu_4_2 {
|
||||
class Locale;
|
||||
}
|
||||
|
||||
|
||||
enum script_direction {
|
||||
B_LEFT_TO_RIGHT = 0,
|
||||
B_RIGHT_TO_LEFT,
|
||||
@@ -24,11 +32,9 @@ class BLanguage {
|
||||
~BLanguage();
|
||||
|
||||
// language name, e.g. "english", "deutsch"
|
||||
const char *Name() const { return fName; }
|
||||
status_t GetName(BString* name);
|
||||
// ISO-639 language code, e.g. "en", "de"
|
||||
const char *Code() const { return fCode; }
|
||||
// ISO-639 language family, e.g. "germanic"
|
||||
const char *Family() const { return fFamily; }
|
||||
const char* Code();
|
||||
|
||||
uint8 Direction() const;
|
||||
|
||||
@@ -41,8 +47,9 @@ class BLanguage {
|
||||
BLanguage(const char *language);
|
||||
void Default();
|
||||
|
||||
char *fName, *fCode, *fFamily, *fStrings[B_NUM_LANGUAGE_STRINGS];
|
||||
char *fStrings[B_NUM_LANGUAGE_STRINGS];
|
||||
uint8 fDirection;
|
||||
icu_4_2::Locale* fICULocale;
|
||||
};
|
||||
|
||||
#endif /* _LANGUAGE_H_ */
|
||||
|
||||
@@ -41,6 +41,8 @@ class BLocaleRoster {
|
||||
status_t GetDefaultCountry(BCountry **) const;
|
||||
void SetDefaultCountry(BCountry *) const;
|
||||
|
||||
status_t GetLanguage(BLanguage** language, BString languageCode) const;
|
||||
|
||||
status_t GetPreferredLanguages(BMessage *) const;
|
||||
status_t SetPreferredLanguages(BMessage *);
|
||||
// the message contains one or more 'language'-string-fields
|
||||
|
||||
Reference in New Issue
Block a user