* Changed AboutSystem to only show the translated language names.
* Added the same hack to ReadOnlyBootPrompt that I put into Locale to work-around the missing font overlays in the app_server; IOW we use some heuristics to decide which language to show. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36730 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
125183f9e5
commit
b588e644ee
@ -169,12 +169,12 @@ TranslationComparator(const void* left, const void* right)
|
||||
BLanguage* language;
|
||||
be_locale_roster->GetLanguage(leftTranslation->languageCode, &language);
|
||||
BString leftName;
|
||||
language->GetName(leftName);
|
||||
language->GetTranslatedName(leftName);
|
||||
delete language;
|
||||
|
||||
be_locale_roster->GetLanguage(rightTranslation->languageCode, &language);
|
||||
BString rightName;
|
||||
language->GetName(rightName);
|
||||
language->GetTranslatedName(rightName);
|
||||
delete language;
|
||||
|
||||
return be_locale->Collator()->Compare(leftName.String(),
|
||||
@ -1067,7 +1067,7 @@ AboutView::_CreateCreditsView()
|
||||
|
||||
be_locale_roster->GetLanguage(translation.languageCode, &lang);
|
||||
langName.Truncate(0);
|
||||
lang->GetName(langName);
|
||||
lang->GetTranslatedName(langName);
|
||||
delete lang;
|
||||
|
||||
fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen);
|
||||
|
@ -3,6 +3,7 @@
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include "BootPromptWindow.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@ -24,6 +25,7 @@
|
||||
#include <StringItem.h>
|
||||
#include <StringView.h>
|
||||
#include <TextView.h>
|
||||
#include <UnicodeChar.h>
|
||||
|
||||
#include "BootPrompt.h"
|
||||
#include "Keymap.h"
|
||||
@ -279,14 +281,23 @@ BootPromptWindow::_PopulateLanguages()
|
||||
// limited to catalogs written for this application, which is on purpose!
|
||||
|
||||
const char* languageString;
|
||||
for (int32 i = 0;
|
||||
installedCatalogs.FindString("langs", i, &languageString) == B_OK;
|
||||
i++) {
|
||||
for (int32 i = 0; installedCatalogs.FindString("langs", i, &languageString)
|
||||
== B_OK; i++) {
|
||||
BLanguage* language;
|
||||
if (be_locale_roster->GetLanguage(languageString,
|
||||
&language) == B_OK) {
|
||||
if (be_locale_roster->GetLanguage(languageString, &language) == B_OK) {
|
||||
BString name;
|
||||
language->GetName(name);
|
||||
|
||||
// TODO: as long as the app_server doesn't support font overlays,
|
||||
// use the translated name if problematic characters are used...
|
||||
const char* string = name.String();
|
||||
while (uint32 code = BUnicodeChar::FromUTF8(&string)) {
|
||||
if (code > 1424) {
|
||||
language->GetTranslatedName(name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LanguageItem* item = new LanguageItem(name.String(),
|
||||
languageString);
|
||||
fLanguagesListView->AddItem(item);
|
||||
@ -295,6 +306,8 @@ BootPromptWindow::_PopulateLanguages()
|
||||
fLanguagesListView->Select(
|
||||
fLanguagesListView->CountItems() - 1);
|
||||
}
|
||||
|
||||
delete language;
|
||||
} else
|
||||
printf("failed to get BLanguage for %s\n", languageString);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user