[haiku-commits] r35864 - in haiku/trunk/src: apps/aboutsystem kits/locale

  • From: pulkomandy@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 15 Mar 2010 12:19:21 +0100 (CET)

Author: pulkomandy
Date: 2010-03-15 12:19:21 +0100 (Mon, 15 Mar 2010)
New Revision: 35864
Changeset: http://dev.haiku-os.org/changeset/35864/haiku

Modified:
   haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp
   haiku/trunk/src/kits/locale/Language.cpp
Log:
 * 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


Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp
===================================================================
--- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp    2010-03-14 23:44:53 UTC 
(rev 35863)
+++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp    2010-03-15 11:19:21 UTC 
(rev 35864)
@@ -48,7 +48,9 @@
 #include <cpu_type.h>
 
 #include <Catalog.h>
+#include <Language.h>
 #include <Locale.h>
+#include <LocaleRoster.h>
 
 #include "HyperTextActions.h"
 #include "HyperTextView.h"
@@ -932,39 +934,90 @@
        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 @@
                "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 @@
                "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"

Modified: haiku/trunk/src/kits/locale/Language.cpp
===================================================================
--- haiku/trunk/src/kits/locale/Language.cpp    2010-03-14 23:44:53 UTC (rev 
35863)
+++ haiku/trunk/src/kits/locale/Language.cpp    2010-03-15 11:19:21 UTC (rev 
35864)
@@ -136,7 +136,7 @@
        // 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;


Other related posts:

  • » [haiku-commits] r35864 - in haiku/trunk/src: apps/aboutsystem kits/locale - pulkomandy