Author: mmadia Date: 2010-05-07 01:44:45 +0200 (Fri, 07 May 2010) New Revision: 36686 Changeset: http://dev.haiku-os.org/changeset/36686/haiku Ticket: http://dev.haiku-os.org/ticket/5408 Modified: haiku/trunk/src/preferences/keyboard/Keyboard.cpp haiku/trunk/src/preferences/keyboard/KeyboardView.cpp haiku/trunk/src/preferences/keyboard/KeyboardWindow.cpp Log: Updated to use B_TRANSLATE* macros. relates to #5408. Modified: haiku/trunk/src/preferences/keyboard/Keyboard.cpp =================================================================== --- haiku/trunk/src/preferences/keyboard/Keyboard.cpp 2010-05-06 23:44:34 UTC (rev 36685) +++ haiku/trunk/src/preferences/keyboard/Keyboard.cpp 2010-05-06 23:44:45 UTC (rev 36686) @@ -32,12 +32,13 @@ switch (message->what) { case ERROR_DETECTED: { - BAlert* errorAlert = new BAlert("Error", TR("Something has gone wrong!"), - TR("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, - B_WARNING_ALERT); + BAlert* errorAlert = new BAlert("Error", + B_TRANSLATE("Something has gone wrong!"), + B_TRANSLATE("OK"), NULL, NULL, + B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT); errorAlert->Go(); be_app->PostMessage(B_QUIT_REQUESTED); - break; + break; } default: BApplication::MessageReceived(message); @@ -49,7 +50,8 @@ void KeyboardApplication::AboutRequested() { - (new BAlert("about", TR("Written by Andrew Edward McCall"), TR("OK")))->Go(); + (new BAlert("about", B_TRANSLATE("Written by Andrew Edward McCall"), + B_TRANSLATE("OK")))->Go(); } Modified: haiku/trunk/src/preferences/keyboard/KeyboardView.cpp =================================================================== --- haiku/trunk/src/preferences/keyboard/KeyboardView.cpp 2010-05-06 23:44:34 UTC (rev 36685) +++ haiku/trunk/src/preferences/keyboard/KeyboardView.cpp 2010-05-06 23:44:45 UTC (rev 36686) @@ -28,37 +28,37 @@ KeyboardView::KeyboardView() : BGroupView() -{ +{ fIconBitmap = BTranslationUtils::GetBitmap("key_bmap"); fClockBitmap = BTranslationUtils::GetBitmap("clock_bmap"); // Create the "Key repeat rate" slider... fRepeatSlider = new BSlider("key_repeat_rate", - TR("Key repeat rate"), + B_TRANSLATE("Key repeat rate"), new BMessage(SLIDER_REPEAT_RATE), 20, 300, B_HORIZONTAL); fRepeatSlider->SetHashMarks(B_HASH_MARKS_BOTTOM); fRepeatSlider->SetHashMarkCount(5); - fRepeatSlider->SetLimitLabels(TR("Slow"),TR("Fast")); - - + fRepeatSlider->SetLimitLabels(B_TRANSLATE("Slow"),B_TRANSLATE("Fast")); + + // Create the "Delay until key repeat" slider... fDelaySlider = new BSlider("delay_until_key_repeat", - TR("Delay until key repeat"), + B_TRANSLATE("Delay until key repeat"), new BMessage(SLIDER_DELAY_RATE), 250000, 1000000, B_HORIZONTAL); fDelaySlider->SetHashMarks(B_HASH_MARKS_BOTTOM); fDelaySlider->SetHashMarkCount(4); - fDelaySlider->SetLimitLabels(TR("Short"),TR("Long")); - + fDelaySlider->SetLimitLabels(B_TRANSLATE("Short"),B_TRANSLATE("Long")); + // Create the "Typing test area" text box... BTextControl* textcontrol = new BTextControl(NULL, - TR("Typing test area"), + B_TRANSLATE("Typing test area"), new BMessage('TTEA')); textcontrol->SetAlignment(B_ALIGN_LEFT, B_ALIGN_CENTER); textcontrol->SetExplicitMinSize(BSize( - textcontrol->StringWidth(TR("Typing test area")), B_SIZE_UNSET)); - + textcontrol->StringWidth(B_TRANSLATE("Typing test area")), B_SIZE_UNSET)); + // Build the layout SetLayout(new BGroupLayout(B_HORIZONTAL)); Modified: haiku/trunk/src/preferences/keyboard/KeyboardWindow.cpp =================================================================== --- haiku/trunk/src/preferences/keyboard/KeyboardWindow.cpp 2010-05-06 23:44:34 UTC (rev 36685) +++ haiku/trunk/src/preferences/keyboard/KeyboardWindow.cpp 2010-05-06 23:44:45 UTC (rev 36686) @@ -28,7 +28,7 @@ #define TR_CONTEXT "KeyboardWindow" KeyboardWindow::KeyboardWindow() - : BWindow(BRect(0, 0, 200, 200), TR("Keyboard"), B_TITLED_WINDOW, + : BWindow(BRect(0, 0, 200, 200), B_TRANSLATE("Keyboard"), B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS) { @@ -38,17 +38,17 @@ fSettingsView = new KeyboardView(); BBox* fSettingsBox = new BBox("keyboard_box"); fSettingsBox->AddChild(fSettingsView); - - // Add the "Default" button.. - fDefaultsButton = new BButton(TR("Defaults"), new BMessage(BUTTON_DEFAULTS)); - + + // Add the "Default" button.. + fDefaultsButton = new BButton(B_TRANSLATE("Defaults"), new BMessage(BUTTON_DEFAULTS)); + // Add the "Revert" button... - fRevertButton = new BButton(TR("Revert"), new BMessage(BUTTON_REVERT)); + fRevertButton = new BButton(B_TRANSLATE("Revert"), new BMessage(BUTTON_REVERT)); fRevertButton->SetEnabled(false); - + // Build the layout SetLayout(new BGroupLayout(B_VERTICAL)); - + AddChild(BGroupLayoutBuilder(B_VERTICAL, 10) .Add(fSettingsBox) .AddGroup(B_HORIZONTAL, 7) @@ -60,11 +60,11 @@ ); BSlider* slider = (BSlider* )FindView("key_repeat_rate"); - if (slider !=NULL) + if (slider !=NULL) slider->SetValue(fSettings.KeyboardRepeatRate()); slider = (BSlider* )FindView("delay_until_key_repeat"); - if (slider !=NULL) + if (slider !=NULL) slider->SetValue(fSettings.KeyboardRepeatDelay()); fDefaultsButton->SetEnabled(fSettings.IsDefaultable()); @@ -73,7 +73,7 @@ BScreen screen; if (screen.Frame().right < Frame().right || screen.Frame().bottom < Frame().bottom) { - CenterOnScreen(); + CenterOnScreen(); } #ifdef DEBUG @@ -109,11 +109,11 @@ fSettings.Defaults(); slider = (BSlider* )FindView("key_repeat_rate"); - if (slider !=NULL) + if (slider !=NULL) slider->SetValue(fSettings.KeyboardRepeatRate()); slider = (BSlider* )FindView("delay_until_key_repeat"); - if (slider !=NULL) + if (slider !=NULL) slider->SetValue(fSettings.KeyboardRepeatDelay()); fDefaultsButton->SetEnabled(false); @@ -124,13 +124,13 @@ case BUTTON_REVERT: { fSettings.Revert(); - + slider = (BSlider* )FindView("key_repeat_rate"); - if (slider !=NULL) + if (slider !=NULL) slider->SetValue(fSettings.KeyboardRepeatRate()); slider = (BSlider* )FindView("delay_until_key_repeat"); - if (slider !=NULL) + if (slider !=NULL) slider->SetValue(fSettings.KeyboardRepeatDelay()); fDefaultsButton->SetEnabled(fSettings.IsDefaultable()); @@ -171,7 +171,7 @@ fSettings.SetKeyboardRepeatDelay(delay); slider = (BSlider* )FindView("delay_until_key_repeat"); - if (slider != NULL) + if (slider != NULL) slider->SetValue(delay); fDefaultsButton->SetEnabled(fSettings.IsDefaultable());