Internationalized and localized to french the CPU Frequency preflet. As always, translation open for improvement. I'm still waiting for people to start provide other languages too ! It's not that hard!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33237 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -11,11 +11,15 @@
|
|||||||
#include "StatusView.h"
|
#include "StatusView.h"
|
||||||
|
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Deskbar.h>
|
#include <Deskbar.h>
|
||||||
#include <GroupView.h>
|
#include <GroupView.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
|
|
||||||
|
#define TR_CONTEXT "CPU Frequency View"
|
||||||
|
|
||||||
const char* kCPUFreqPreferencesFile = "CPUFrequency";
|
const char* kCPUFreqPreferencesFile = "CPUFrequency";
|
||||||
const char* kPrefSignature = "application/x-vnd.Haiku-CPUFrequencyPref";
|
const char* kPrefSignature = "application/x-vnd.Haiku-CPUFrequencyPref";
|
||||||
const char* kPreferencesFileName = "CPUFrequency";
|
const char* kPreferencesFileName = "CPUFrequency";
|
||||||
@@ -40,21 +44,21 @@ CPUFrequencyView::CPUFrequencyView(BRect frame,
|
|||||||
BRect rect = Bounds();
|
BRect rect = Bounds();
|
||||||
rect.InsetBy(5, 5);
|
rect.InsetBy(5, 5);
|
||||||
BBox *policyBox = new BBox(rect, "policyBox");
|
BBox *policyBox = new BBox(rect, "policyBox");
|
||||||
policyBox->SetLabel("Stepping Policy");
|
policyBox->SetLabel(TR("Stepping Policy"));
|
||||||
BGroupLayout* policyLayout = new BGroupLayout(B_VERTICAL);
|
BGroupLayout* policyLayout = new BGroupLayout(B_VERTICAL);
|
||||||
policyLayout->SetInsets(10, policyBox->TopBorderOffset() * 2 + 10, 10, 10);
|
policyLayout->SetInsets(10, policyBox->TopBorderOffset() * 2 + 10, 10, 10);
|
||||||
policyLayout->SetSpacing(10);
|
policyLayout->SetSpacing(10);
|
||||||
policyBox->SetLayout(policyLayout);
|
policyBox->SetLayout(policyLayout);
|
||||||
mainLayout->AddView(policyBox);
|
mainLayout->AddView(policyBox);
|
||||||
|
|
||||||
fPolicyMenu = new BMenu("Stepping Policy");
|
fPolicyMenu = new BMenu(TR("Stepping Policy"));
|
||||||
BMenuField *menuField = new BMenuField("Stepping Policy", fPolicyMenu);
|
BMenuField *menuField = new BMenuField(TR("Stepping Policy"), fPolicyMenu);
|
||||||
|
|
||||||
policyLayout->AddView(menuField);
|
policyLayout->AddView(menuField);
|
||||||
|
|
||||||
// dynamic stepping
|
// dynamic stepping
|
||||||
BBox *dynamicBox = new BBox(rect, "dynamicBox");
|
BBox *dynamicBox = new BBox(rect, "dynamicBox");
|
||||||
dynamicBox->SetLabel("Dynamic Stepping");
|
dynamicBox->SetLabel(TR("Dynamic Stepping"));
|
||||||
BGroupLayout* dynamicLayout = new BGroupLayout(B_VERTICAL);
|
BGroupLayout* dynamicLayout = new BGroupLayout(B_VERTICAL);
|
||||||
dynamicLayout->SetInsets(10, dynamicBox->TopBorderOffset() * 2 + 10,
|
dynamicLayout->SetInsets(10, dynamicBox->TopBorderOffset() * 2 + 10,
|
||||||
10, 10);
|
10, 10);
|
||||||
@@ -67,7 +71,7 @@ CPUFrequencyView::CPUFrequencyView(BRect frame,
|
|||||||
|
|
||||||
fIntegrationTime = new BTextControl(BRect(0,0,Bounds().Width(),10),
|
fIntegrationTime = new BTextControl(BRect(0,0,Bounds().Width(),10),
|
||||||
"intergal",
|
"intergal",
|
||||||
"Integration Time [ms]", "",
|
TR("Integration Time [ms]"), "",
|
||||||
new BMessage(kIntegrationTimeChanged));
|
new BMessage(kIntegrationTimeChanged));
|
||||||
|
|
||||||
dynamicLayout->AddView(fColorStepView);
|
dynamicLayout->AddView(fColorStepView);
|
||||||
@@ -75,7 +79,7 @@ CPUFrequencyView::CPUFrequencyView(BRect frame,
|
|||||||
|
|
||||||
// status view
|
// status view
|
||||||
BBox *statusBox = new BBox(rect, "statusBox");
|
BBox *statusBox = new BBox(rect, "statusBox");
|
||||||
statusBox->SetLabel("CPU Frequency Status View");
|
statusBox->SetLabel(TR("CPU Frequency Status View"));
|
||||||
BGroupLayout* statusLayout = new BGroupLayout(B_HORIZONTAL);
|
BGroupLayout* statusLayout = new BGroupLayout(B_HORIZONTAL);
|
||||||
statusLayout->SetInsets(10, statusBox->TopBorderOffset() * 2 + 10, 10, 10);
|
statusLayout->SetInsets(10, statusBox->TopBorderOffset() * 2 + 10, 10, 10);
|
||||||
statusLayout->SetSpacing(10);
|
statusLayout->SetSpacing(10);
|
||||||
@@ -87,7 +91,7 @@ CPUFrequencyView::CPUFrequencyView(BRect frame,
|
|||||||
fStatusView->ShowPopUpMenu(false);
|
fStatusView->ShowPopUpMenu(false);
|
||||||
|
|
||||||
fInstallButton = new BButton("installButton",
|
fInstallButton = new BButton("installButton",
|
||||||
"Install Replicant into Deskbar",
|
TR("Install Replicant into Deskbar"),
|
||||||
new BMessage(kInstallIntoDeskbar));
|
new BMessage(kInstallIntoDeskbar));
|
||||||
|
|
||||||
statusLayout->AddView(fStatusView);
|
statusLayout->AddView(fStatusView);
|
||||||
|
|||||||
@@ -10,9 +10,14 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define TR_CONTEXT "Color Step View"
|
||||||
|
|
||||||
|
|
||||||
const int32 kColorBarHeight = 15;
|
const int32 kColorBarHeight = 15;
|
||||||
|
|
||||||
const uint32 kMSGSliderChanged = '&slc';
|
const uint32 kMSGSliderChanged = '&slc';
|
||||||
@@ -280,7 +285,7 @@ ColorStepView::_InitView()
|
|||||||
|
|
||||||
BRect sliderFrame(Bounds());
|
BRect sliderFrame(Bounds());
|
||||||
|
|
||||||
fSlider = new BSlider(sliderFrame, "StepSlider", "Step up by CPU usage:",
|
fSlider = new BSlider(sliderFrame, "StepSlider", TR("Step up by CPU usage:"),
|
||||||
new BMessage(kSteppingChanged), 0, 100);
|
new BMessage(kSteppingChanged), 0, 100);
|
||||||
fSlider->SetModificationMessage(new BMessage(kMSGSliderChanged));
|
fSlider->SetModificationMessage(new BMessage(kMSGSliderChanged));
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,19 @@ Preference CPUFrequency :
|
|||||||
DriverInterface.cpp
|
DriverInterface.cpp
|
||||||
main.cpp
|
main.cpp
|
||||||
StatusView.cpp
|
StatusView.cpp
|
||||||
: be $(TARGET_LIBSUPC++)
|
: be $(TARGET_LIBSUPC++) liblocale.so
|
||||||
: cpufrequency.rdef
|
: cpufrequency.rdef
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs CPUFrequency :
|
||||||
|
x-vnd.Haiku-CPUFrequencyPref
|
||||||
|
:
|
||||||
|
ColorStepView.cpp
|
||||||
|
CPUFrequencyView.cpp
|
||||||
|
main.cpp
|
||||||
|
StatusView.cpp
|
||||||
|
PreferencesWindow.h
|
||||||
|
: en.catalog
|
||||||
|
: fr.catkeys
|
||||||
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
@@ -38,6 +40,7 @@
|
|||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
|
|
||||||
|
#define TR_CONTEXT "Pref Window"
|
||||||
|
|
||||||
// messages PrefFileWatcher
|
// messages PrefFileWatcher
|
||||||
const uint32 kUpdatedPreferences = '&UdP';
|
const uint32 kUpdatedPreferences = '&UdP';
|
||||||
@@ -331,12 +334,12 @@ PreferencesWindow<Preferences>::PreferencesWindow(const char* title,
|
|||||||
fPreferencesView(NULL)
|
fPreferencesView(NULL)
|
||||||
{
|
{
|
||||||
BGroupView* buttonView = new BGroupView(B_HORIZONTAL);
|
BGroupView* buttonView = new BGroupView(B_HORIZONTAL);
|
||||||
fDefaultButton = new BButton("Defaults",
|
fDefaultButton = new BButton(TR("Defaults"),
|
||||||
new BMessage(kDefaultMsg));
|
new BMessage(kDefaultMsg));
|
||||||
|
|
||||||
buttonView->AddChild(fDefaultButton);
|
buttonView->AddChild(fDefaultButton);
|
||||||
buttonView->GetLayout()->AddItem(BSpaceLayoutItem::CreateHorizontalStrut(7));
|
buttonView->GetLayout()->AddItem(BSpaceLayoutItem::CreateHorizontalStrut(7));
|
||||||
fRevertButton = new BButton("Revert", new BMessage(kRevertMsg));
|
fRevertButton = new BButton(TR("Revert"), new BMessage(kRevertMsg));
|
||||||
|
|
||||||
fRevertButton->SetEnabled(false);
|
fRevertButton->SetEnabled(false);
|
||||||
buttonView->AddChild(fRevertButton);
|
buttonView->AddChild(fRevertButton);
|
||||||
|
|||||||
@@ -12,8 +12,10 @@
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Deskbar.h>
|
#include <Deskbar.h>
|
||||||
#include <GroupLayout.h>
|
#include <GroupLayout.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <PopUpMenu.h>
|
#include <PopUpMenu.h>
|
||||||
@@ -22,6 +24,8 @@
|
|||||||
|
|
||||||
#include "CPUFrequencyView.h"
|
#include "CPUFrequencyView.h"
|
||||||
|
|
||||||
|
#define TR_CONTEXT "Status view"
|
||||||
|
|
||||||
|
|
||||||
extern "C" _EXPORT BView *instantiate_deskbar_item(void);
|
extern "C" _EXPORT BView *instantiate_deskbar_item(void);
|
||||||
|
|
||||||
@@ -190,18 +194,18 @@ FrequencyMenu::FrequencyMenu(BMenu* menu, BHandler* target,
|
|||||||
fStorage(storage),
|
fStorage(storage),
|
||||||
fInterface(interface)
|
fInterface(interface)
|
||||||
{
|
{
|
||||||
fDynamicPerformance = new BMenuItem("Dynamic Performance",
|
fDynamicPerformance = new BMenuItem(TR("Dynamic Performance"),
|
||||||
new BMessage(kMsgPolicyDynamic));
|
new BMessage(kMsgPolicyDynamic));
|
||||||
fHighPerformance = new BMenuItem("High Performance",
|
fHighPerformance = new BMenuItem(TR("High Performance"),
|
||||||
new BMessage(kMsgPolicyPerformance));
|
new BMessage(kMsgPolicyPerformance));
|
||||||
fLowEnergie = new BMenuItem("Low Energy",
|
fLowEnergie = new BMenuItem(TR("Low Energy"),
|
||||||
new BMessage(kMsgPolicyLowEnergy));
|
new BMessage(kMsgPolicyLowEnergy));
|
||||||
|
|
||||||
menu->AddItem(fDynamicPerformance);
|
menu->AddItem(fDynamicPerformance);
|
||||||
menu->AddItem(fHighPerformance);
|
menu->AddItem(fHighPerformance);
|
||||||
menu->AddItem(fLowEnergie);
|
menu->AddItem(fLowEnergie);
|
||||||
|
|
||||||
fCustomStateMenu = new BMenu("Set State");
|
fCustomStateMenu = new BMenu(TR("Set State"));
|
||||||
|
|
||||||
StateList* stateList = fInterface->GetCpuFrequencyStates();
|
StateList* stateList = fInterface->GetCpuFrequencyStates();
|
||||||
for (int i = 0; i < stateList->CountItems(); i++) {
|
for (int i = 0; i < stateList->CountItems(); i++) {
|
||||||
@@ -397,9 +401,9 @@ StatusView::~StatusView()
|
|||||||
void
|
void
|
||||||
StatusView::_AboutRequested()
|
StatusView::_AboutRequested()
|
||||||
{
|
{
|
||||||
BAlert *alert = new BAlert("about", "CPU Frequency\n"
|
BAlert *alert = new BAlert("about", TR("CPU Frequency\n"
|
||||||
"\twritten by Clemens Zeidler\n"
|
"\twritten by Clemens Zeidler\n"
|
||||||
"\tCopyright 2009, Haiku, Inc.\n", "Ok");
|
"\tCopyright 2009, Haiku, Inc.\n"), TR("Ok"));
|
||||||
BTextView *view = alert->TextView();
|
BTextView *view = alert->TextView();
|
||||||
BFont font;
|
BFont font;
|
||||||
|
|
||||||
@@ -479,7 +483,7 @@ StatusView::AttachedToWindow()
|
|||||||
fPreferencesMenu->SetFont(be_plain_font);
|
fPreferencesMenu->SetFont(be_plain_font);
|
||||||
|
|
||||||
fPreferencesMenu->AddSeparatorItem();
|
fPreferencesMenu->AddSeparatorItem();
|
||||||
fOpenPrefItem = new BMenuItem("Open Speedstep Preferences" B_UTF8_ELLIPSIS,
|
fOpenPrefItem = new BMenuItem(TR("Open Speedstep Preferences" B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kMsgOpenSSPreferences));
|
new BMessage(kMsgOpenSSPreferences));
|
||||||
fPreferencesMenu->AddItem(fOpenPrefItem);
|
fPreferencesMenu->AddItem(fOpenPrefItem);
|
||||||
fOpenPrefItem->SetTarget(this);
|
fOpenPrefItem->SetTarget(this);
|
||||||
@@ -649,8 +653,8 @@ StatusView::_OpenPreferences()
|
|||||||
ret = be_roster->ActivateApp(info.team);
|
ret = be_roster->ActivateApp(info.team);
|
||||||
}
|
}
|
||||||
if (ret < B_OK) {
|
if (ret < B_OK) {
|
||||||
BString errorMessage("Launching the CPU Frequency preflet failed.\n\n"
|
BString errorMessage(TR("Launching the CPU Frequency preflet failed.\n\n"
|
||||||
"Error: ");
|
"Error: "));
|
||||||
errorMessage << strerror(ret);
|
errorMessage << strerror(ret);
|
||||||
BAlert* alert = new BAlert("launch error", errorMessage.String(),
|
BAlert* alert = new BAlert("launch error", errorMessage.String(),
|
||||||
"Ok");
|
"Ok");
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
1 french x-vnd.Haiku-CPUFrequencyPref 1947607562
|
||||||
|
Ok Status view Ok
|
||||||
|
Integration Time [ms] CPU Frequency View Temps d'intégration [ms]
|
||||||
|
High Performance Status view Haute performance
|
||||||
|
CPU Frequency Status View CPU Frequency View État de la fréquence du processeur
|
||||||
|
Dynamic Performance Status view Performance dynamique
|
||||||
|
Step up by CPU usage: Color Step View Accélération par utilisation processeur:
|
||||||
|
Stepping Policy CPU Frequency View Attitude d'accélération
|
||||||
|
Set State Status view Changer l'état
|
||||||
|
Open Speedstep PreferencesxE2x80xA6 Status view Préférences speedstepxE2x80xA6
|
||||||
|
Launching the CPU Frequency preflet failed.\n\nError: Status view Échec de lancement des préférences de fréquence du processeur.\n\nErreur:
|
||||||
|
Install Replicant into Deskbar CPU Frequency View Installer le réplicant dans la Deskbar
|
||||||
|
Low Energy Status view Basse consommation
|
||||||
|
Dynamic Stepping CPU Frequency View Accélération dynamique
|
||||||
|
CPU Frequency\n\twritten by Clemens Zeidler\n\tCopyright 2009, Haiku, Inc.\n Status view Fréquence du processeur\n\técrit par Clemens Zeidler\n\tCopyright 2009, Haiku, Inc.\n
|
||||||
|
CPU Frequency Main window Fréquence du processeur
|
||||||
|
Defaults Pref Window Défaire
|
||||||
|
Revert Pref Window Défaire
|
||||||
@@ -9,14 +9,21 @@
|
|||||||
#include "PreferencesWindow.h"
|
#include "PreferencesWindow.h"
|
||||||
#include "CPUFrequencyView.h"
|
#include "CPUFrequencyView.h"
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
|
|
||||||
|
#define TR_CONTEXT "Main window"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char* argv[])
|
main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
BApplication *app = new BApplication(kPrefSignature);
|
BApplication *app = new BApplication(kPrefSignature);
|
||||||
|
|
||||||
|
BCatalog cat;
|
||||||
|
be_locale->GetAppCatalog(&cat);
|
||||||
|
|
||||||
PreferencesWindow<freq_preferences> *window;
|
PreferencesWindow<freq_preferences> *window;
|
||||||
window = new PreferencesWindow<freq_preferences>("CPU Frequency",
|
window = new PreferencesWindow<freq_preferences>(TR("CPU Frequency"),
|
||||||
kPreferencesFileName,
|
kPreferencesFileName,
|
||||||
kDefaultPreferences);
|
kDefaultPreferences);
|
||||||
CPUFrequencyView* prefView = new CPUFrequencyView(BRect(0, 0, 400, 350),
|
CPUFrequencyView* prefView = new CPUFrequencyView(BRect(0, 0, 400, 350),
|
||||||
|
|||||||
Reference in New Issue
Block a user