From f237e4182b933878d74a6cff693fb4229f99c404 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 15 Mar 2010 11:19:21 +0000 Subject: [PATCH] * Fix a small bug in BLanguage::GetName * Use BLanguage in AboutSystem to get the names of the languages in the credit list, no need to add useless work for the translators * Add some contributors to the credits for japanese translation git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35864 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/aboutsystem/AboutSystem.cpp | 167 ++++++++++++++++++++++++--- src/kits/locale/Language.cpp | 2 +- 2 files changed, 152 insertions(+), 17 deletions(-) diff --git a/src/apps/aboutsystem/AboutSystem.cpp b/src/apps/aboutsystem/AboutSystem.cpp index 9509cf6c1e..6cdede8f66 100644 --- a/src/apps/aboutsystem/AboutSystem.cpp +++ b/src/apps/aboutsystem/AboutSystem.cpp @@ -48,7 +48,9 @@ #include #include +#include #include +#include #include "HyperTextActions.h" #include "HyperTextView.h" @@ -932,39 +934,90 @@ AboutView::_CreateCreditsView() fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuOrange); fCreditsView->Insert(TR("Translations:\n")); + // TODO : sort languages alphabetically using collators + BLanguage* lang; + BString langName; + + be_locale_roster->GetLanguage(&lang, "bg"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nBulgarian\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "cssvb94\n" ); + + be_locale_roster->GetLanguage(&lang, "nl"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nDutch\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Meanwhile\n" ); + + be_locale_roster->GetLanguage(&lang, "eo"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nEsperanto\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Travis D. Reed (Dancxjo)\n" ); + + be_locale_roster->GetLanguage(&lang, "fi"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nFinnish\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Jaakko Leikas (Garjala)\n" ); + + be_locale_roster->GetLanguage(&lang, "fr"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nFrench\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Jean-Loïc Charroud\n" "Adrien Destugues (PulkoMandy)\n" ); + + be_locale_roster->GetLanguage(&lang, "de"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nGerman\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Colin Günther\n" @@ -974,46 +1027,104 @@ AboutView::_CreateCreditsView() "Matthias Spreiter\n" "svend\n" ); + + be_locale_roster->GetLanguage(&lang, "hu"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nHungarian\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Zoltán Mizsei (miqlas)\n" "Zoltán Szabó (Bird)\n" ); + + be_locale_roster->GetLanguage(&lang, "it"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nItalian\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Andrea Bernardi\n" ); + + be_locale_roster->GetLanguage(&lang, "ja"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nJapanese\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "The JPBE.net user group\n" + "Takashi Murai\n" + "Jorge G. Mare (Koki)\n" ); + + be_locale_roster->GetLanguage(&lang, "lt"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nLituanian\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Algirdas Buckus\n" ); + + be_locale_roster->GetLanguage(&lang, "pl"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nPolish\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Artur Wyszyński\n" "Hubert Hareńczyk\n" ); + + be_locale_roster->GetLanguage(&lang, "pt"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nPortuguese\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Marcos Alves (Xeon3D)\n" ); + + be_locale_roster->GetLanguage(&lang, "ru"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nRussian\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Tatyana Fursic (iceid)\n" @@ -1023,24 +1134,48 @@ AboutView::_CreateCreditsView() "Reznikov Sergei (Diver)\n" "Michael Smirnov\n" ); + + be_locale_roster->GetLanguage(&lang, "es"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nSpanish\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Nicolás C (CapitanPico)\n" "Oscar Carballal (oscarcp)\n" "Miguel Zúñiga González (miguel~1.mx)\n" ); + + be_locale_roster->GetLanguage(&lang, "sv"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nSwedish\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Johan Holmberg\n" "Jimmy Olsson (phalax)\n" "Victor Widell\n" ); + + be_locale_roster->GetLanguage(&lang, "uk"); + langName.Truncate(0); + lang->GetName(&langName); + delete lang; + fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &kHaikuGreen); - fCreditsView->Insert(TR("\nUkrainian\n")); + fCreditsView->Insert("\n"); + fCreditsView->Insert(langName); + fCreditsView->Insert("\n"); fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kDarkGrey); fCreditsView->Insert( "Alex Rudyk (totish)\n" diff --git a/src/kits/locale/Language.cpp b/src/kits/locale/Language.cpp index fec69317f4..22a22dd9f9 100644 --- a/src/kits/locale/Language.cpp +++ b/src/kits/locale/Language.cpp @@ -136,7 +136,7 @@ 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->getDisplayName(s); + fICULocale->getDisplayLanguage(s); BStringByteSink converter(name); s.toUTF8(converter); return B_OK;