Updated to use B_TRANSLATE* macros. relates to #5408.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36688 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia 2010-05-06 23:53:12 +00:00
parent 3d7bf37bf3
commit b850bd3b17
3 changed files with 91 additions and 76 deletions

View File

@ -179,7 +179,7 @@ LocalePreflet::AboutRequested()
authors[0] = "Axel Dörfler"; authors[0] = "Axel Dörfler";
authors[1] = "Adrien Destugues"; authors[1] = "Adrien Destugues";
authors[2] = NULL; authors[2] = NULL;
(new BAboutWindow(TR("Locale"), 2005, authors))->Show(); (new BAboutWindow(B_TRANSLATE("Locale"), 2005, authors))->Show();
} }

View File

@ -60,13 +60,15 @@ LocaleWindow::LocaleWindow()
SetLayout(new BGroupLayout(B_HORIZONTAL)); SetLayout(new BGroupLayout(B_HORIZONTAL));
BButton* button = new BButton(TR("Defaults"), new BMessage(kMsgDefaults)); BButton* button = new BButton(B_TRANSLATE("Defaults"),
fRevertButton = new BButton(TR("Revert"), new BMessage(kMsgRevert)); new BMessage(kMsgDefaults));
fRevertButton = new BButton(B_TRANSLATE("Revert"),
new BMessage(kMsgRevert));
fRevertButton->SetEnabled(false); fRevertButton->SetEnabled(false);
BTabView* tabView = new BTabView("tabview"); 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)); languageTab->SetLayout(new BGroupLayout(B_VERTICAL, 0));
// first list: available languages // first list: available languages
@ -111,9 +113,9 @@ LocaleWindow::LocaleWindow()
fLanguageListView->FullListSortItems(compare_typed_list_items); fLanguageListView->FullListSortItems(compare_typed_list_items);
} else { } else {
BAlert* myAlert = new BAlert("Error", BAlert* myAlert = new BAlert("Error",
TR("Unable to find the available languages! You can't use this " B_TRANSLATE("Unable to find the available languages! You can't "
"preflet!"), "use this preflet!"),
TR("OK"), NULL, NULL, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT);
myAlert->Go(); myAlert->Go();
} }
@ -150,16 +152,16 @@ LocaleWindow::LocaleWindow()
languageTab->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 10) languageTab->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 10)
.AddGroup(B_VERTICAL, 10) .AddGroup(B_VERTICAL, 10)
.Add(new BStringView("", TR("Available languages"))) .Add(new BStringView("", B_TRANSLATE("Available languages")))
.Add(scrollView) .Add(scrollView)
.End() .End()
.AddGroup(B_VERTICAL, 10) .AddGroup(B_VERTICAL, 10)
.Add(new BStringView("", TR("Preferred languages"))) .Add(new BStringView("", B_TRANSLATE("Preferred languages")))
.Add(scrollViewEnabled) .Add(scrollViewEnabled)
.End() .End()
.View()); .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)); countryTab->SetLayout(new BGroupLayout(B_VERTICAL, 0));
BListView* listView = new BListView("country", B_SINGLE_SELECTION_LIST); BListView* listView = new BListView("country", B_SINGLE_SELECTION_LIST);

View File

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