Localization for keyboard and mouse preflet by mt. Thanks !

French localization by me. Please improve !


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34118 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2009-11-18 20:13:56 +00:00
parent 143e4fbc3e
commit 1892e95632
14 changed files with 236 additions and 179 deletions
+11 -1
View File
@@ -14,6 +14,16 @@ Preference Keyboard :
KeyboardSettings.cpp
KeyboardView.cpp
KeyboardWindow.cpp
: translation be $(TARGET_LIBSUPC++)
: translation be $(TARGET_LIBSUPC++) liblocale.so
: Keyboard.rdef
;
DoCatalogs Keyboard :
x-vnd.Haiku-Keyboard
:
Keyboard.cpp
KeyboardWindow.cpp
KeyboardView.cpp
: en.catalog
: fr.catkeys
;
+7 -4
View File
@@ -15,10 +15,13 @@
#include <Alert.h>
#undef TR_CONTEXT
#define TR_CONTEXT "KeyboardApplication"
KeyboardApplication::KeyboardApplication()
: BApplication("application/x-vnd.Haiku-Keyboard")
{
be_locale->GetAppCatalog(&fCatalog);
new KeyboardWindow();
}
@@ -26,11 +29,11 @@ KeyboardApplication::KeyboardApplication()
void
KeyboardApplication::MessageReceived(BMessage* message)
{
switch(message->what) {
switch (message->what) {
case ERROR_DETECTED:
{
BAlert *errorAlert = new BAlert("Error", "Something has gone wrong!",
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
BAlert* errorAlert = new BAlert("Error", TR("Something has gone wrong!"),
TR("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_WARNING_ALERT);
errorAlert->Go();
be_app->PostMessage(B_QUIT_REQUESTED);
@@ -46,7 +49,7 @@ KeyboardApplication::MessageReceived(BMessage* message)
void
KeyboardApplication::AboutRequested()
{
(new BAlert("about", "Written by Andrew Edward McCall", "OK"))->Go();
(new BAlert("about", TR("Written by Andrew Edward McCall"), TR("OK")))->Go();
}
+7 -2
View File
@@ -11,14 +11,19 @@
#define KEYBOARD_H
#include <Application.h>
#include <Catalog.h>
#include <Locale.h>
class KeyboardApplication : public BApplication
{
public:
KeyboardApplication();
KeyboardApplication();
void MessageReceived(BMessage *message);
void MessageReceived(BMessage* message);
void AboutRequested(void);
private:
BCatalog fCatalog;
};
#endif
+44 -87
View File
@@ -11,108 +11,72 @@
#include <TranslationUtils.h>
#include <Bitmap.h>
#include <Button.h>
#include <Catalog.h>
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <Locale.h>
#include <Slider.h>
#include <TextControl.h>
#include <Window.h>
#include <Font.h>
#include "KeyboardView.h"
#include "KeyboardMessages.h"
#include "KeyboardSettings.h"
// user interface
const uint32 kBorderSpace = 10;
const uint32 kItemSpace = 7;
#undef TR_CONTEXT
#define TR_CONTEXT "KeyboardView"
KeyboardView::KeyboardView(BRect rect)
: BView(rect, "keyboard_view", B_FOLLOW_LEFT | B_FOLLOW_TOP,
B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP)
{
BRect frame;
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
KeyboardView::KeyboardView()
: BGroupView()
{
fIconBitmap = BTranslationUtils::GetBitmap("key_bmap");
fClockBitmap = BTranslationUtils::GetBitmap("clock_bmap");
float labelwidth = StringWidth("Delay until key repeat")+20;
font_height fontHeight;
be_plain_font->GetHeight(&fontHeight);
float labelheight = fontHeight.ascent + fontHeight.descent +
fontHeight.leading;
// Create the "Key repeat rate" slider...
frame.Set(kBorderSpace,kBorderSpace,kBorderSpace + labelwidth,kBorderSpace + (labelheight*2) + (kBorderSpace*2));
fRepeatSlider = new BSlider(frame,"key_repeat_rate",
"Key repeat rate",
new BMessage(SLIDER_REPEAT_RATE),
20,300,B_BLOCK_THUMB,
B_FOLLOW_LEFT,B_WILL_DRAW);
fRepeatSlider = new BSlider("key_repeat_rate",
TR("Key repeat rate"),
new BMessage(SLIDER_REPEAT_RATE),
20, 300, B_HORIZONTAL);
fRepeatSlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
fRepeatSlider->SetHashMarkCount(5);
fRepeatSlider->SetLimitLabels("Slow","Fast");
fRepeatSlider->SetLimitLabels(TR("Slow"),TR("Fast"));
// Create the "Delay until key repeat" slider...
frame.OffsetBy(0,frame.Height() + kBorderSpace);
fDelaySlider = new BSlider(frame,"delay_until_key_repeat",
"Delay until key repeat",
new BMessage(SLIDER_DELAY_RATE),250000,1000000,
B_BLOCK_THUMB,B_FOLLOW_LEFT,B_WILL_DRAW);
fDelaySlider = new BSlider("delay_until_key_repeat",
TR("Delay until key repeat"),
new BMessage(SLIDER_DELAY_RATE),
250000, 1000000, B_HORIZONTAL);
fDelaySlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
fDelaySlider->SetHashMarkCount(4);
fDelaySlider->SetLimitLabels("Short","Long");
fDelaySlider->SetLimitLabels(TR("Short"),TR("Long"));
// Create the "Typing test area" text box...
frame.OffsetBy(0,frame.Height() + 15);
frame.right = fDelaySlider->Frame().right + kBorderSpace
+ (fIconBitmap != NULL ? fIconBitmap->Bounds().Width() : 0);
BTextControl *textcontrol = new BTextControl(frame,"typing_test_area",NULL,
"Typing test area",
new BMessage('TTEA'),
B_FOLLOW_LEFT,B_WILL_DRAW);
textcontrol->SetAlignment(B_ALIGN_LEFT,B_ALIGN_CENTER);
float width, height;
textcontrol->GetPreferredSize(&width, &height);
textcontrol->ResizeTo(frame.Width(),height);
// Create the box for the sliders...
frame.left = frame.top = kBorderSpace;
frame.right = frame.left + fDelaySlider->Frame().right + (kBorderSpace * 2)
+ (fClockBitmap != NULL ? fClockBitmap->Bounds().Width() : 0);
frame.bottom = textcontrol->Frame().bottom + (kBorderSpace * 2);
fBox = new BBox(frame,"keyboard_box",B_FOLLOW_LEFT, B_WILL_DRAW,
B_FANCY_BORDER);
AddChild(fBox);
fBox->AddChild(fRepeatSlider);
fBox->AddChild(fDelaySlider);
fBox->AddChild(textcontrol);
BTextControl* textcontrol = new BTextControl(NULL,
TR("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));
// Build the layout
SetLayout(new BGroupLayout(B_HORIZONTAL));
//Add the "Default" button..
frame.left = kBorderSpace;
frame.top = fBox->Frame().bottom + kBorderSpace;
frame.right = frame.left + 1;
frame.bottom = frame.top + 1;
BButton *button = new BButton(frame,"keyboard_defaults","Defaults",
new BMessage(BUTTON_DEFAULTS));
button->ResizeToPreferred();
AddChild(button);
// Add the "Revert" button...
frame = button->Frame();
frame.OffsetBy(frame.Width() + kItemSpace, 0);
button = new BButton(frame,"keyboard_revert","Revert",
new BMessage(BUTTON_REVERT));
button->ResizeToPreferred();
button->SetEnabled(false);
AddChild(button);
ResizeTo(fBox->Frame().right + kBorderSpace, button->Frame().bottom + kBorderSpace);
AddChild(BGroupLayoutBuilder(B_VERTICAL, 10)
.Add(fRepeatSlider)
.Add(fDelaySlider)
.Add(textcontrol)
.SetInsets(10, 10, 10, 10)
);
}
KeyboardView::~KeyboardView()
{
}
void
KeyboardView::Draw(BRect updateFrame)
{
@@ -122,19 +86,12 @@ KeyboardView::Draw(BRect updateFrame)
if (fIconBitmap != NULL) {
pt.y = fRepeatSlider->Frame().bottom - 35
- fIconBitmap->Bounds().Height() / 3;
fBox->DrawBitmap(fIconBitmap,pt);
DrawBitmap(fIconBitmap, pt);
}
if (fClockBitmap != NULL) {
pt.y = fDelaySlider->Frame().bottom - 35
- fClockBitmap->Bounds().Height() / 3;
fBox->DrawBitmap(fClockBitmap,pt);
DrawBitmap(fClockBitmap, pt);
}
}
void
KeyboardView::AttachedToWindow(void)
{
Window()->ResizeTo(Bounds().Width(), Bounds().Height());
}
+6 -6
View File
@@ -11,23 +11,23 @@
#define KEYBOARD_VIEW_H
#include <Box.h>
#include <GroupView.h>
#include <Slider.h>
#include <SupportDefs.h>
#include <InterfaceDefs.h>
#include <Application.h>
class KeyboardView : public BView
class KeyboardView : public BGroupView
{
public:
KeyboardView(BRect frame);
KeyboardView();
virtual ~KeyboardView();
void Draw(BRect frame);
void AttachedToWindow(void);
private:
BBitmap *fIconBitmap;
BBitmap *fClockBitmap;
BBox *fBox;
BSlider *fDelaySlider;
BSlider *fRepeatSlider;
};
+59 -51
View File
@@ -13,42 +13,69 @@
#include "KeyboardView.h"
#include "KeyboardWindow.h"
#include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <Locale.h>
#include <Message.h>
#include <Screen.h>
#include <Slider.h>
#include <TextControl.h>
#undef TR_CONTEXT
#define TR_CONTEXT "KeyboardWindow"
KeyboardWindow::KeyboardWindow()
: BWindow(BRect(0, 0, 200, 200), "Keyboard", B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
: BWindow(BRect(0, 0, 200, 200), TR("Keyboard"), B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS
| B_AUTO_UPDATE_SIZE_LIMITS)
{
MoveTo(fSettings.WindowCorner());
// Add the main settings view
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 "Revert" button...
fRevertButton = new BButton(TR("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)
.Add(fDefaultsButton)
.Add(fRevertButton)
.AddGlue()
.End()
.SetInsets(10, 10, 10, 10)
);
BSlider* slider = (BSlider* )FindView("key_repeat_rate");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatRate());
slider = (BSlider* )FindView("delay_until_key_repeat");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatDelay());
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
// center window if it would be off-screen
BScreen screen;
if (screen.Frame().right < Frame().right
|| screen.Frame().bottom < Frame().bottom) {
MoveTo((screen.Frame().right - Bounds().right) / 2,
(screen.Frame().bottom - Bounds().bottom) / 2);
CenterOnScreen();
}
fView = new KeyboardView(Bounds());
AddChild(fView);
BSlider *slider = (BSlider *)FindView("key_repeat_rate");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatRate());
slider = (BSlider *)FindView("delay_until_key_repeat");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatDelay());
BButton *button = (BButton *)FindView("keyboard_defaults");
if (button !=NULL)
button->SetEnabled(fSettings.IsDefaultable());
#ifdef DEBUG
fSettings.Dump();
#endif
@@ -75,49 +102,40 @@ void
KeyboardWindow::MessageReceived(BMessage* message)
{
BSlider* slider = NULL;
BButton* button = NULL;
switch (message->what) {
case BUTTON_DEFAULTS:
{
fSettings.Defaults();
slider = (BSlider *)FindView("key_repeat_rate");
slider = (BSlider* )FindView("key_repeat_rate");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatRate());
slider = (BSlider *)FindView("delay_until_key_repeat");
slider = (BSlider* )FindView("delay_until_key_repeat");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatDelay());
button = (BButton *)FindView("keyboard_defaults");
if (button !=NULL)
button->SetEnabled(false);
fDefaultsButton->SetEnabled(false);
button = (BButton *)FindView("keyboard_revert");
if (button !=NULL)
button->SetEnabled(true);
fRevertButton->SetEnabled(true);
break;
}
case BUTTON_REVERT:
{
fSettings.Revert();
slider = (BSlider *)FindView("key_repeat_rate");
slider = (BSlider* )FindView("key_repeat_rate");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatRate());
slider = (BSlider *)FindView("delay_until_key_repeat");
slider = (BSlider* )FindView("delay_until_key_repeat");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatDelay());
button = (BButton *)FindView("keyboard_defaults");
if (button !=NULL)
button->SetEnabled(fSettings.IsDefaultable());
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
button = (BButton *)FindView("keyboard_revert");
if (button !=NULL)
button->SetEnabled(false);
fRevertButton->SetEnabled(false);
break;
}
case SLIDER_REPEAT_RATE:
@@ -127,13 +145,9 @@ KeyboardWindow::MessageReceived(BMessage* message)
break;
fSettings.SetKeyboardRepeatRate(rate);
button = (BButton *)FindView("keyboard_defaults");
if (button !=NULL)
button->SetEnabled(fSettings.IsDefaultable());
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
button = (BButton *)FindView("keyboard_revert");
if (button !=NULL)
button->SetEnabled(true);
fRevertButton->SetEnabled(true);
break;
}
case SLIDER_DELAY_RATE:
@@ -154,19 +168,13 @@ KeyboardWindow::MessageReceived(BMessage* message)
if (delay >= 875000)
delay = 1000000;
fSettings.SetKeyboardRepeatDelay(delay);
slider = (BSlider *)FindView("delay_until_key_repeat");
slider = (BSlider* )FindView("delay_until_key_repeat");
if (slider !=NULL)
slider->SetValue(delay);
button = (BButton *)FindView("keyboard_defaults");
if (button !=NULL)
button->SetEnabled(fSettings.IsDefaultable());
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
button = (BButton *)FindView("keyboard_revert");
if (button !=NULL)
button->SetEnabled(true);
fRevertButton->SetEnabled(true);
break;
}
+5 -2
View File
@@ -10,6 +10,7 @@
#ifndef KEYBOARD_WINDOW_H
#define KEYBOARD_WINDOW_H
#include <Button.h>
#include <Window.h>
#include "KeyboardSettings.h"
@@ -21,11 +22,13 @@ public:
KeyboardWindow();
bool QuitRequested();
void MessageReceived(BMessage *message);
void MessageReceived(BMessage* message);
private:
KeyboardView *fView;
KeyboardView *fSettingsView;
KeyboardSettings fSettings;
BButton *fDefaultsButton;
BButton *fRevertButton;
};
#endif
+10 -1
View File
@@ -8,7 +8,16 @@ Preference Mouse :
MouseWindow.cpp
MouseView.cpp
SettingsView.cpp
: translation be $(TARGET_LIBSUPC++)
: translation be $(TARGET_LIBSUPC++) liblocale.so
: Mouse.rdef
;
DoCatalogs Mouse :
x-vnd.Haiku-Mouse
:
Mouse.cpp
MouseWindow.cpp
SettingsView.cpp
: en.catalog
: fr.catkeys
;
+6 -1
View File
@@ -15,6 +15,8 @@
#include <Alert.h>
#include <Screen.h>
#undef TR_CONTEXT
#define TR_CONTEXT "MouseApplication"
const char* kSignature = "application/x-vnd.Haiku-Mouse";
@@ -23,6 +25,8 @@ MouseApplication::MouseApplication()
:
BApplication(kSignature)
{
be_locale->GetAppCatalog(&fCatalog);
BRect rect(0, 0, 397, 293);
MouseWindow *window = new MouseWindow(rect);
window->Show();
@@ -32,7 +36,8 @@ MouseApplication::MouseApplication()
void
MouseApplication::AboutRequested()
{
(new BAlert("about", "...by Andrew Edward McCall", "Dig Deal"))->Go();
(new BAlert("about", TR("...by Andrew Edward McCall"),
TR("Dig Deal")))->Go();
}
+4
View File
@@ -12,6 +12,8 @@
#include <Application.h>
#include <Catalog.h>
#include <Locale.h>
class MouseApplication : public BApplication {
@@ -19,6 +21,8 @@ public:
MouseApplication();
virtual void AboutRequested();
private:
BCatalog fCatalog;
};
#endif /* MOUSE_H */
+7 -3
View File
@@ -14,8 +14,10 @@
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <Button.h>
#include <Catalog.h>
#include <CheckBox.h>
#include <Debug.h>
#include <Locale.h>
#include <Menu.h>
#include <MenuField.h>
#include <MenuItem.h>
@@ -27,10 +29,12 @@
#include "MouseConstants.h"
#include "SettingsView.h"
#undef TR_CONTEXT
#define TR_CONTEXT "MouseWindow"
MouseWindow::MouseWindow(BRect _rect)
:
BWindow(_rect, "Mouse", B_TITLED_WINDOW,
BWindow(_rect, TR("Mouse"), B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS |
B_AUTO_UPDATE_SIZE_LIMITS)
{
@@ -40,11 +44,11 @@ MouseWindow::MouseWindow(BRect _rect)
fSettingsBox->AddChild(fSettingsView);
// Add the "Default" button
fDefaultsButton = new BButton("Defaults", new BMessage(kMsgDefaults));
fDefaultsButton = new BButton(TR("Defaults"), new BMessage(kMsgDefaults));
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
// Add the "Revert" button
fRevertButton = new BButton("Revert", new BMessage(kMsgRevert));
fRevertButton = new BButton(TR("Revert"), new BMessage(kMsgRevert));
fRevertButton->SetEnabled(false);
SetPulseRate(100000);
+32 -21
View File
@@ -14,10 +14,12 @@
#include <Bitmap.h>
#include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <Debug.h>
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <InterfaceDefs.h>
#include <Locale.h>
#include <MenuField.h>
#include <MenuItem.h>
#include <PopUpMenu.h>
@@ -62,6 +64,8 @@ focus_follows_mouse_mode_to_index(mode_focus_follows_mouse mode)
// #pragma mark -
#undef TR_CONTEXT
#define TR_CONTEXT "SettingsView"
SettingsView::SettingsView(MouseSettings &settings)
: BBox("main_view"),
@@ -69,48 +73,53 @@ SettingsView::SettingsView(MouseSettings &settings)
{
// Add the "Mouse Type" pop up menu
fTypeMenu = new BPopUpMenu("unknown");
fTypeMenu->AddItem(new BMenuItem("1-Button", new BMessage(kMsgMouseType)));
fTypeMenu->AddItem(new BMenuItem("2-Button", new BMessage(kMsgMouseType)));
fTypeMenu->AddItem(new BMenuItem("3-Button", new BMessage(kMsgMouseType)));
fTypeMenu->AddItem(new BMenuItem(TR("1-Button"),
new BMessage(kMsgMouseType)));
fTypeMenu->AddItem(new BMenuItem(TR("2-Button"),
new BMessage(kMsgMouseType)));
fTypeMenu->AddItem(new BMenuItem(TR("3-Button"),
new BMessage(kMsgMouseType)));
BMenuField *fTypeField = new BMenuField("Mouse type:", fTypeMenu, NULL);
BMenuField *fTypeField = new BMenuField(TR("Mouse type:"),
fTypeMenu, NULL);
fTypeField->SetAlignment(B_ALIGN_RIGHT);
// Create the "Double-click speed slider...
fClickSpeedSlider = new BSlider("double_click_speed", "Double-click speed",
new BMessage(kMsgDoubleClickSpeed), 0, 1000, B_HORIZONTAL);
fClickSpeedSlider = new BSlider("double_click_speed",
TR("Double-click speed"), new BMessage(kMsgDoubleClickSpeed),
0, 1000, B_HORIZONTAL);
fClickSpeedSlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
fClickSpeedSlider->SetHashMarkCount(5);
fClickSpeedSlider->SetLimitLabels("Slow", "Fast");
fClickSpeedSlider->SetLimitLabels(TR("Slow"), TR("Fast"));
// Create the "Mouse Speed" slider...
fMouseSpeedSlider = new BSlider("mouse_speed", "Mouse Speed",
fMouseSpeedSlider = new BSlider("mouse_speed", TR("Mouse Speed"),
new BMessage(kMsgMouseSpeed), 0, 1000, B_HORIZONTAL);
fMouseSpeedSlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
fMouseSpeedSlider->SetHashMarkCount(7);
fMouseSpeedSlider->SetLimitLabels("Slow", "Fast");
fMouseSpeedSlider->SetLimitLabels(TR("Slow"), TR("Fast"));
// Create the "Mouse Acceleration" slider...
fAccelerationSlider = new BSlider("mouse_acceleration",
"Mouse Acceleration", new BMessage(kMsgAccelerationFactor),
TR("Mouse Acceleration"), new BMessage(kMsgAccelerationFactor),
0, 1000, B_HORIZONTAL);
fAccelerationSlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
fAccelerationSlider->SetHashMarkCount(5);
fAccelerationSlider->SetLimitLabels("Slow", "Fast");
fAccelerationSlider->SetLimitLabels(TR("Slow"), TR("Fast"));
// Mouse image...
fMouseView = new MouseView(fSettings);
// Create the "Double-click test area" text box...
BTextControl *fDoubleClick = new BTextControl(NULL,
"Double-click test area", NULL);
TR("Double-click test area"), NULL);
fDoubleClick->SetAlignment(B_ALIGN_LEFT, B_ALIGN_CENTER);
// Add the "Mouse focus mode" pop up menu
fFocusMenu = new BPopUpMenu("Click to Activate");
fFocusMenu = new BPopUpMenu(TR("Click to Activate"));
const char *focusLabels[] = {"Click to Activate", "Click to Focus",
"Focus Follows Mouse"};
const char *focusLabels[] = {TR_MARK("Click to Activate"),
TR_MARK("Click to Focus"),TR_MARK("Focus Follows Mouse")};
const mode_mouse focusModes[] = {B_NORMAL_MOUSE, B_CLICK_TO_FOCUS_MOUSE,
B_FOCUS_FOLLOWS_MOUSE};
@@ -118,16 +127,18 @@ SettingsView::SettingsView(MouseSettings &settings)
BMessage *message = new BMessage(kMsgMouseFocusMode);
message->AddInt32("mode", focusModes[i]);
fFocusMenu->AddItem(new BMenuItem(focusLabels[i], message));
fFocusMenu->AddItem(new BMenuItem(TR(focusLabels[i]), message));
}
BMenuField *fFocusField = new BMenuField("Focus mode:", fFocusMenu, NULL);
BMenuField *fFocusField = new BMenuField(TR("Focus mode:"),
fFocusMenu, NULL);
fFocusField->SetAlignment(B_ALIGN_RIGHT);
// Add the "Focus follows mouse mode" pop up menu
fFocusFollowsMouseMenu = new BPopUpMenu("Normal");
fFocusFollowsMouseMenu = new BPopUpMenu(TR("Normal"));
const char *focusFollowsMouseLabels[] = {"Normal", "Warp", "Instant Warp"};
const char *focusFollowsMouseLabels[] = {TR_MARK("Normal"),
TR_MARK("Warp"), TR_MARK("Instant Warp")};
const mode_focus_follows_mouse focusFollowsMouseModes[] =
{B_NORMAL_FOCUS_FOLLOWS_MOUSE, B_WARP_FOCUS_FOLLOWS_MOUSE,
B_INSTANT_WARP_FOCUS_FOLLOWS_MOUSE};
@@ -138,7 +149,7 @@ SettingsView::SettingsView(MouseSettings &settings)
focusFollowsMouseModes[i]);
fFocusFollowsMouseMenu->AddItem(new BMenuItem(
focusFollowsMouseLabels[i], message));
TR(focusFollowsMouseLabels[i]), message));
}
BMenuField *fFocusFollowsMouseField = new BMenuField(
@@ -146,7 +157,7 @@ SettingsView::SettingsView(MouseSettings &settings)
fFocusFollowsMouseField->SetAlignment(B_ALIGN_RIGHT);
// Add the "Click-through" check box
fAcceptFirstClickBox = new BCheckBox("Accept first click",
fAcceptFirstClickBox = new BCheckBox(TR("Accept first click"),
new BMessage(kMsgAcceptFirstClick));
// dividers