[haiku-commits] r36688 - haiku/trunk/src/preferences/locale

  • From: mattmadia@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 7 May 2010 01:53:12 +0200 (CEST)

Author: mmadia
Date: 2010-05-07 01:53:12 +0200 (Fri, 07 May 2010)
New Revision: 36688
Changeset: http://dev.haiku-os.org/changeset/36688/haiku
Ticket: http://dev.haiku-os.org/ticket/5408

Modified:
   haiku/trunk/src/preferences/locale/Locale.cpp
   haiku/trunk/src/preferences/locale/LocaleWindow.cpp
   haiku/trunk/src/preferences/locale/TimeFormatSettingsView.cpp
Log:
 Updated to use B_TRANSLATE* macros. relates to #5408.

Modified: haiku/trunk/src/preferences/locale/Locale.cpp
===================================================================
--- haiku/trunk/src/preferences/locale/Locale.cpp       2010-05-06 23:45:23 UTC 
(rev 36687)
+++ haiku/trunk/src/preferences/locale/Locale.cpp       2010-05-06 23:53:12 UTC 
(rev 36688)
@@ -179,7 +179,7 @@
        authors[0] = "Axel Dörfler";
        authors[1] = "Adrien Destugues";
        authors[2] = NULL;
-       (new BAboutWindow(TR("Locale"), 2005, authors))->Show();
+       (new BAboutWindow(B_TRANSLATE("Locale"), 2005, authors))->Show();
 }
 
 

Modified: haiku/trunk/src/preferences/locale/LocaleWindow.cpp
===================================================================
--- haiku/trunk/src/preferences/locale/LocaleWindow.cpp 2010-05-06 23:45:23 UTC 
(rev 36687)
+++ haiku/trunk/src/preferences/locale/LocaleWindow.cpp 2010-05-06 23:53:12 UTC 
(rev 36688)
@@ -60,13 +60,15 @@
 
        SetLayout(new BGroupLayout(B_HORIZONTAL));
 
-       BButton* button = new BButton(TR("Defaults"), new 
BMessage(kMsgDefaults));
-       fRevertButton = new BButton(TR("Revert"), new BMessage(kMsgRevert));
+       BButton* button = new BButton(B_TRANSLATE("Defaults"),
+               new BMessage(kMsgDefaults));
+       fRevertButton = new BButton(B_TRANSLATE("Revert"),
+               new BMessage(kMsgRevert));
        fRevertButton->SetEnabled(false);
 
        BTabView* tabView = new BTabView("tabview");
 
-       BView* languageTab = new BView(TR("Language"), B_WILL_DRAW);
+       BView* languageTab = new BView(B_TRANSLATE("Language"), B_WILL_DRAW);
        languageTab->SetLayout(new BGroupLayout(B_VERTICAL, 0));
 
        // first list: available languages
@@ -111,9 +113,9 @@
                fLanguageListView->FullListSortItems(compare_typed_list_items);
        } else {
                BAlert* myAlert = new BAlert("Error",
-                       TR("Unable to find the available languages! You can't 
use this "
-                               "preflet!"),
-                       TR("OK"), NULL, NULL,
+                       B_TRANSLATE("Unable to find the available languages! 
You can't "
+                               "use this preflet!"),
+                       B_TRANSLATE("OK"), NULL, NULL,
                        B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT);
                myAlert->Go();
        }
@@ -150,16 +152,16 @@
 
        languageTab->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 10)
                .AddGroup(B_VERTICAL, 10)
-                       .Add(new BStringView("", TR("Available languages")))
+                       .Add(new BStringView("", B_TRANSLATE("Available 
languages")))
                        .Add(scrollView)
                        .End()
                .AddGroup(B_VERTICAL, 10)
-                       .Add(new BStringView("", TR("Preferred languages")))
+                       .Add(new BStringView("", B_TRANSLATE("Preferred 
languages")))
                        .Add(scrollViewEnabled)
                        .End()
                .View());
 
-       BView* countryTab = new BView(TR("Country"), B_WILL_DRAW);
+       BView* countryTab = new BView(B_TRANSLATE("Country"), B_WILL_DRAW);
        countryTab->SetLayout(new BGroupLayout(B_VERTICAL, 0));
 
        BListView* listView = new BListView("country", B_SINGLE_SELECTION_LIST);

Modified: haiku/trunk/src/preferences/locale/TimeFormatSettingsView.cpp
===================================================================
--- haiku/trunk/src/preferences/locale/TimeFormatSettingsView.cpp       
2010-05-06 23:45:23 UTC (rev 36687)
+++ haiku/trunk/src/preferences/locale/TimeFormatSettingsView.cpp       
2010-05-06 23:53:12 UTC (rev 36688)
@@ -70,51 +70,58 @@
        BMenu* menu = new BMenu("");
        *field = new BMenuField("", menu);
 
-       BPopUpMenu* dayMenu = new BPopUpMenu(TR("Day"));
+       BPopUpMenu* dayMenu = new BPopUpMenu(B_TRANSLATE("Day"));
        // Not all available ICU settings are listed here. It's possible to add 
some
        // other things if you ever need.
        menu->AddItem(dayMenu);
-               dayMenu->AddItem(new DateMenuItem(TR("Day in month"), "d", 
*field));
-               dayMenu->AddItem(new DateMenuItem(TR("Day in month (2 
digits)"), "dd",
-                       *field));
+               dayMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Day in month"), "d", *field));
+               dayMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Day in month (2 digits)"), "dd", *field));
                /*
-               dayMenu->AddItem(new DateMenuItem(TR("Day in year"), "D", 
*field));
-               dayMenu->AddItem(new DateMenuItem(TR("Day in year (2 digits)"), 
"DD",
-                       *field));
-               dayMenu->AddItem(new DateMenuItem(TR("Day in year (3 digits)"), 
"DDD",
-                       *field));
+               dayMenu->AddItem(new DateMenuItem(B_TRANSLATE("Day in year"),
+                       "D", *field));
+               dayMenu->AddItem(new DateMenuItem(B_TRANSLATE("Day in year (2 
digits)"),
+                        "DD", *field));
+               dayMenu->AddItem(new DateMenuItem(B_TRANSLATE("Day in year (3 
digits)"),
+                       "DDD", *field));
                */
-               dayMenu->AddItem(new DateMenuItem(TR("Day of week"), "e",
-                       *field));
+               dayMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Day of week"), "e", *field));
                //dayMenu->AddItem(new DateMenuItem("Day of week (short text)", 
"eee",
                //      *field));
                //dayMenu->AddItem(new DateMenuItem("Day of week (full text)", 
"eeee",
                //      *field));
-               dayMenu->AddItem(new DateMenuItem(TR("Day of week (short 
name)"), "E",
-                       *field));
-               dayMenu->AddItem(new DateMenuItem(TR("Day of week (name)"), 
"EEEE",
-                       *field));
-               dayMenu->AddItem(new DateMenuItem(TR("Day of week in month"), 
"F",
-                       *field));
-               //dayMenu->AddItem(new DateMenuItem(TR("julian day"), "g", 
*field));
+               dayMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Day of week (short name)"), "E", *field));
+               dayMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Day of week (name)"), "EEEE", *field));
+               dayMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Day of week in month"), "F", *field));
+               //dayMenu->AddItem(new DateMenuItem(
+               //      B_TRANSLATE("julian day"), "g", *field));
                //dayMenu->AddItem(new BMenuItem("c", msg));
-       BPopUpMenu* monthMenu = new BPopUpMenu(TR("Month"));
+       BPopUpMenu* monthMenu = new BPopUpMenu(B_TRANSLATE("Month"));
        menu->AddItem(monthMenu);
-               monthMenu->AddItem(new DateMenuItem(TR("Month number"), "M", 
*field));
-               monthMenu->AddItem(new DateMenuItem(TR("Month number (2 
digits)"), "MM",
-                       *field));
-               monthMenu->AddItem(new DateMenuItem(TR("Month name"), "MMMM", 
*field));
+               monthMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Month number"), "M", *field));
+               monthMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Month number (2 digits)"), "MM", *field));
+               monthMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Month name"), "MMMM", *field));
                //monthMenu->AddItem(new DateMenuItem("L", "L", *field));
-       BPopUpMenu* yearMenu = new BPopUpMenu(TR("Year"));
+       BPopUpMenu* yearMenu = new BPopUpMenu(B_TRANSLATE("Year"));
        menu->AddItem(yearMenu);
                // And here is some ICU kludge... sorry about that.
                if (longFormat)
-                       yearMenu->AddItem(new DateMenuItem(TR("Year"), "y", 
*field));
+                       yearMenu->AddItem(new DateMenuItem(
+                               B_TRANSLATE("Year"), "y", *field));
                else {
-                       yearMenu->AddItem(new DateMenuItem(TR("Year (4 
digits)"), "yyyy",
-                               *field));
+                       yearMenu->AddItem(new DateMenuItem(
+                               B_TRANSLATE("Year (4 digits)"), "yyyy", 
*field));
                }
-               yearMenu->AddItem(new DateMenuItem(TR("Year (2 digits)"), "yy", 
*field));
+               yearMenu->AddItem(new DateMenuItem(
+                       B_TRANSLATE("Year (2 digits)"), "yy", *field));
                //yearMenu->AddItem(new DateMenuItem("Y", "Y", *field));
                //yearMenu->AddItem(new DateMenuItem("u", "u", *field));
 }
@@ -157,26 +164,26 @@
                CreateDateMenu(&fDateMenu[i], false);
        }
 
-       BPopUpMenu* menu = new BPopUpMenu(TR("Separator"));
-       menu->AddItem(new BMenuItem(TR("None"),
+       BPopUpMenu* menu = new BPopUpMenu(B_TRANSLATE("Separator"));
+       menu->AddItem(new BMenuItem(B_TRANSLATE("None"),
                new BMessage(kSettingsContentsModified)));
-       menu->AddItem(new BMenuItem(TR("Space"),
+       menu->AddItem(new BMenuItem(B_TRANSLATE("Space"),
                new BMessage(kSettingsContentsModified)));
        menu->AddItem(new BMenuItem("-", new 
BMessage(kSettingsContentsModified)));
        menu->AddItem(new BMenuItem("/", new 
BMessage(kSettingsContentsModified)));
        menu->AddItem(new BMenuItem("\\", new 
BMessage(kSettingsContentsModified)));
        menu->AddItem(new BMenuItem(".", new 
BMessage(kSettingsContentsModified)));
 
-       fSeparatorMenuField = new BMenuField(TR("Separator:"), menu);
+       fSeparatorMenuField = new BMenuField(B_TRANSLATE("Separator:"), menu);
 
        BBox* clockBox = new BBox("Clock");
-       clockBox->SetLabel(TR("Clock"));
+       clockBox->SetLabel(B_TRANSLATE("Clock"));
 
        {
-               f24HrRadioButton = new BRadioButton("", TR("24 hour"),
+               f24HrRadioButton = new BRadioButton("", B_TRANSLATE("24 hour"),
                                new BMessage(kSettingsContentsModified));
 
-               f12HrRadioButton = new BRadioButton("", TR("12 hour"),
+               f12HrRadioButton = new BRadioButton("", B_TRANSLATE("12 hour"),
                                new BMessage(kSettingsContentsModified));
 
                clockBox->AddChild(BGroupLayoutBuilder(B_VERTICAL, 3)
@@ -192,38 +199,44 @@
        fNumberFormatExampleView = new BStringView("", "");
 
        BTextControl* numberThousand = new BTextControl("",
-               TR("Thousand separator: "), "", new 
BMessage(kSettingsContentsModified));
-       BTextControl* numberDecimal = new BTextControl("", TR("Decimal 
separator: "),
-               "", new BMessage(kSettingsContentsModified));
+               B_TRANSLATE("Thousand separator: "), "",
+               new BMessage(kSettingsContentsModified));
+       BTextControl* numberDecimal = new BTextControl("",
+               B_TRANSLATE("Decimal separator: "),     "",
+               new BMessage(kSettingsContentsModified));
        // TODO number of decimal digits (spinbox ?)
-       BCheckBox* numberLeadingZero = new BCheckBox("", TR("Leading 0"),
+       BCheckBox* numberLeadingZero = new BCheckBox("", B_TRANSLATE("Leading 
0"),
                new BMessage(kSettingsContentsModified));
-       BTextControl* numberList = new BTextControl("", TR("List separator: 
"),"",
+       BTextControl* numberList = new BTextControl("",
+               B_TRANSLATE("List separator: "),"",
                new BMessage(kSettingsContentsModified));
        // Unit system (US/Metric) (radio)
 
-       BTextControl* currencySymbol = new BTextControl("", TR("Currency 
symbol:"),
-               "", new BMessage(kSettingsContentsModified));
-       menu = new BPopUpMenu(TR("Negative marker"));
+       BTextControl* currencySymbol = new BTextControl("",
+               B_TRANSLATE("Currency symbol:"), "",
+               new BMessage(kSettingsContentsModified));
+       menu = new BPopUpMenu(B_TRANSLATE("Negative marker"));
        menu->AddItem(new BMenuItem("-", new 
BMessage(kSettingsContentsModified)));
        menu->AddItem(new BMenuItem("()", new 
BMessage(kSettingsContentsModified)));
 
-       BMenuField* currencyNegative = new BMenuField(TR("Negative marker:"), 
menu);
+       BMenuField* currencyNegative = new BMenuField(
+               B_TRANSLATE("Negative marker:"), menu);
 
        BTextControl* currencyDecimal = new BTextControl("",
-               TR("Decimal separator: "), "", new 
BMessage(kSettingsContentsModified));
-       BCheckBox* currencyLeadingZero = new BCheckBox("", TR("Leading 0"),
+               B_TRANSLATE("Decimal separator: "), "",
                new BMessage(kSettingsContentsModified));
+       BCheckBox* currencyLeadingZero = new BCheckBox("",
+               B_TRANSLATE("Leading 0"), new 
BMessage(kSettingsContentsModified));
 
        BBox* formatBox = new BBox("Symbol position");
-       formatBox->SetLabel(TR("Symbol position"));
+       formatBox->SetLabel(B_TRANSLATE("Symbol position"));
 
        {
-               BRadioButton* beforeRadioButton = new BRadioButton("", 
TR("Before"),
-                               new BMessage(kSettingsContentsModified));
+               BRadioButton* beforeRadioButton = new BRadioButton("",
+                       B_TRANSLATE("Before"), new 
BMessage(kSettingsContentsModified));
 
-               BRadioButton* afterRadioButton = new BRadioButton("", 
TR("After"),
-                               new BMessage(kSettingsContentsModified));
+               BRadioButton* afterRadioButton = new BRadioButton("",
+                       B_TRANSLATE("After"), new 
BMessage(kSettingsContentsModified));
 
                formatBox->AddChild(BGroupLayoutBuilder(B_VERTICAL, 3)
                                .Add(beforeRadioButton)
@@ -235,20 +248,20 @@
        _UpdateExamples();
        _ParseDateFormat();
 
-       fDateBox = new BBox(TR("Date"));
-       fTimeBox = new BBox(TR("Time"));
-       fNumbersBox = new BBox(TR("Numbers"));
-       fCurrencyBox = new BBox(TR("Currency"));
+       fDateBox = new BBox(B_TRANSLATE("Date"));
+       fTimeBox = new BBox(B_TRANSLATE("Time"));
+       fNumbersBox = new BBox(B_TRANSLATE("Numbers"));
+       fCurrencyBox = new BBox(B_TRANSLATE("Currency"));
 
-       fDateBox->SetLabel(TR("Date"));
-       fTimeBox->SetLabel(TR("Time"));
-       fNumbersBox->SetLabel(TR("Numbers"));
-       fCurrencyBox->SetLabel(TR("Currency"));
+       fDateBox->SetLabel(B_TRANSLATE("Date"));
+       fTimeBox->SetLabel(B_TRANSLATE("Time"));
+       fNumbersBox->SetLabel(B_TRANSLATE("Numbers"));
+       fCurrencyBox->SetLabel(B_TRANSLATE("Currency"));
 
        fDateBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 5)
                .AddGroup(B_VERTICAL, 5)
                        .AddGroup(B_HORIZONTAL, 3)
-                               .Add(new BStringView("",TR("Long format:")))
+                               .Add(new BStringView("",B_TRANSLATE("Long 
format:")))
                                .Add(fLongDateExampleView)
                                .AddGlue()
                                .End()
@@ -269,7 +282,7 @@
                                .Add(fLongDateSeparator[3])
                                .End()
                        .AddGroup(B_HORIZONTAL, 3)
-                               .Add(new BStringView("",TR("Short format:")))
+                               .Add(new BStringView("",B_TRANSLATE("Short 
format:")))
                                .Add(fShortDateExampleView)
                                .AddGlue()
                                .End()
@@ -284,12 +297,12 @@
        fTimeBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 5)
                .AddGroup(B_VERTICAL, 5)
                        .AddGroup(B_HORIZONTAL, 3)
-                               .Add(new BStringView("",TR("Long format:")))
+                               .Add(new BStringView("",B_TRANSLATE("Long 
format:")))
                                .Add(fLongTimeExampleView)
                                .AddGlue()
                                .End()
                        .AddGroup(B_HORIZONTAL, 3)
-                               .Add(new BStringView("",TR("Short format:")))
+                               .Add(new BStringView("",B_TRANSLATE("Short 
format:")))
                                .Add(fShortTimeExampleView)
                                .AddGlue()
                                .End()
@@ -306,7 +319,7 @@
        fNumbersBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 5)
                .AddGroup(B_VERTICAL, 5)
                        .AddGroup(B_HORIZONTAL, 3)
-                               .Add(new BStringView("",TR("Example:")))
+                               .Add(new 
BStringView("",B_TRANSLATE("Example:")))
                                .Add(fNumberFormatExampleView)
                                .AddGlue()
                                .End()
@@ -683,7 +696,7 @@
 
                if (!isFound) {
                        fDateMenu[i]->MenuItem()->SetLabel(
-                               str.Append(TR(" (unknown format)")));
+                               str.Append(B_TRANSLATE(" (unknown format)")));
                }
 
                fieldBegin = parsePointer;


Other related posts:

  • » [haiku-commits] r36688 - haiku/trunk/src/preferences/locale - mattmadia