diff --git a/data/catalogs/preferences/network/fr.catkeys b/data/catalogs/preferences/network/fr.catkeys new file mode 100644 index 0000000000..66e4627959 --- /dev/null +++ b/data/catalogs/preferences/network/fr.catkeys @@ -0,0 +1,17 @@ +1 french x-vnd.Haiku-Network 1787390642 +Gateway: EthernetSettingsView Passerelle : +Netmask: EthernetSettingsView Masque de sous-réseau : +DHCP EthernetSettingsView DHCP +DNS #2: EthernetSettingsView DNS #2: +Apply EthernetSettingsView Appliquer +DNS #1: EthernetSettingsView DNS #1: +Network NetworkWindow Réseau +Adapter: EthernetSettingsView Adaptateur : +IP Address: EthernetSettingsView Adresse IP : +Revert EthernetSettingsView Défaire +Sending auto-config message failed: EthernetSettingsView Échec d'envoi du message de configuration automatique : +Mode: EthernetSettingsView Mode : +The net_server needs to run for the auto configuration! EthernetSettingsView Le net_server doit être lancé pour la configuration automatique ! +Auto-configuring failed: EthernetSettingsView Échec de la configuration automatique : +Static EthernetSettingsView Statique +Ok EthernetSettingsView Ok diff --git a/src/preferences/network/EthernetSettingsView.cpp b/src/preferences/network/EthernetSettingsView.cpp index 5d2ffd62d9..640cb3c77d 100644 --- a/src/preferences/network/EthernetSettingsView.cpp +++ b/src/preferences/network/EthernetSettingsView.cpp @@ -18,11 +18,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -87,6 +89,8 @@ SetupTextControl(BTextControl *control) // #pragma mark - +#undef TR_CONTEXT +#define TR_CONTEXT "EthernetSettingsView" EthernetSettingsView::EthernetSettingsView() : BView("EthernetSettingsView", 0, NULL), @@ -121,21 +125,21 @@ EthernetSettingsView::EthernetSettingsView() } BPopUpMenu* modeMenu = new BPopUpMenu("modes"); - modeMenu->AddItem(new BMenuItem("Static", new BMessage(kMsgMode))); - modeMenu->AddItem(new BMenuItem("DHCP", new BMessage(kMsgMode))); + modeMenu->AddItem(new BMenuItem(TR("Static"), new BMessage(kMsgMode))); + modeMenu->AddItem(new BMenuItem(TR("DHCP"), new BMessage(kMsgMode))); //modeMenu->AddSeparatorItem(); //BMenuItem* offItem = new BMenuItem("Disabled", NULL); //modeMenu->AddItem(offItem); - fDeviceMenuField = new BMenuField("Adapter:", deviceMenu); + fDeviceMenuField = new BMenuField(TR("Adapter:"), deviceMenu); layout->AddItem(fDeviceMenuField->CreateLabelLayoutItem(), 0, 0); layout->AddItem(fDeviceMenuField->CreateMenuBarLayoutItem(), 1, 0); - fTypeMenuField = new BMenuField("Mode:", modeMenu); + fTypeMenuField = new BMenuField(TR("Mode:"), modeMenu); layout->AddItem(fTypeMenuField->CreateLabelLayoutItem(), 0, 1); layout->AddItem(fTypeMenuField->CreateMenuBarLayoutItem(), 1, 1); - fIPTextControl = new BTextControl("IP Address:", "", NULL); + fIPTextControl = new BTextControl(TR("IP Address:"), "", NULL); SetupTextControl(fIPTextControl); BLayoutItem* layoutItem = fIPTextControl->CreateTextViewLayoutItem(); @@ -146,24 +150,24 @@ EthernetSettingsView::EthernetSettingsView() layout->AddItem(fIPTextControl->CreateLabelLayoutItem(), 0, 2); layout->AddItem(layoutItem, 1, 2); - fNetMaskTextControl = new BTextControl("Netmask:", "", NULL); + fNetMaskTextControl = new BTextControl(TR("Netmask:"), "", NULL); SetupTextControl(fNetMaskTextControl); layout->AddItem(fNetMaskTextControl->CreateLabelLayoutItem(), 0, 3); layout->AddItem(fNetMaskTextControl->CreateTextViewLayoutItem(), 1, 3); - fGatewayTextControl = new BTextControl("Gateway:", "", NULL); + fGatewayTextControl = new BTextControl(TR("Gateway:"), "", NULL); SetupTextControl(fGatewayTextControl); layout->AddItem(fGatewayTextControl->CreateLabelLayoutItem(), 0, 4); layout->AddItem(fGatewayTextControl->CreateTextViewLayoutItem(), 1, 4); // TODO: Replace the DNS text controls by a BListView with add/remove // functionality and so on... - fPrimaryDNSTextControl = new BTextControl("DNS #1:", "", NULL); + fPrimaryDNSTextControl = new BTextControl(TR("DNS #1:"), "", NULL); SetupTextControl(fPrimaryDNSTextControl); layout->AddItem(fPrimaryDNSTextControl->CreateLabelLayoutItem(), 0, 5); layout->AddItem(fPrimaryDNSTextControl->CreateTextViewLayoutItem(), 1, 5); - fSecondaryDNSTextControl = new BTextControl("DNS #2:", "", NULL); + fSecondaryDNSTextControl = new BTextControl(TR("DNS #2:"), "", NULL); SetupTextControl(fSecondaryDNSTextControl); layout->AddItem(fSecondaryDNSTextControl->CreateLabelLayoutItem(), 0, 6); layout->AddItem(fSecondaryDNSTextControl->CreateTextViewLayoutItem(), 1, 6); @@ -179,13 +183,13 @@ EthernetSettingsView::EthernetSettingsView() // enabling/disabling) BGroupView* buttonGroup = new BGroupView(B_HORIZONTAL); - fRevertButton = new BButton("Revert", new BMessage(kMsgRevert)); + fRevertButton = new BButton(TR("Revert"), new BMessage(kMsgRevert)); fRevertButton->SetEnabled(false); buttonGroup->GroupLayout()->AddView(fRevertButton); buttonGroup->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue()); - fApplyButton = new BButton("Apply", new BMessage(kMsgApply)); + fApplyButton = new BButton(TR("Apply"), new BMessage(kMsgApply)); buttonGroup->GroupLayout()->AddView(fApplyButton); rootLayout->AddView(controlsGroup); @@ -304,9 +308,9 @@ EthernetSettingsView::_ShowConfiguration(Settings* settings) fNetMaskTextControl->SetText(settings->Netmask()); if (settings->AutoConfigure() == true) - item = fTypeMenuField->Menu()->FindItem("DHCP"); + item = fTypeMenuField->Menu()->FindItem(TR("DHCP")); else - item = fTypeMenuField->Menu()->FindItem("Static"); + item = fTypeMenuField->Menu()->FindItem(TR("Static")); if (item) item->SetMarked(true); @@ -349,7 +353,7 @@ EthernetSettingsView::_ApplyControlsToConfiguration() fCurrentSettings->SetGateway(fGatewayTextControl->Text()); fCurrentSettings->SetAutoConfigure( - strcmp(fTypeMenuField->Menu()->FindMarked()->Label(), "DHCP") == 0); + strcmp(fTypeMenuField->Menu()->FindMarked()->Label(), TR("DHCP")) == 0); fCurrentSettings->NameServers().MakeEmpty(); fCurrentSettings->NameServers().AddItem(new BString( @@ -456,8 +460,8 @@ EthernetSettingsView::_TriggerAutoConfig(const char* device) { BMessenger networkServer(kNetServerSignature); if (!networkServer.IsValid()) { - (new BAlert("error", "The net_server needs to run for the auto " - "configuration!", "Ok"))->Go(); + (new BAlert("error", TR("The net_server needs to run for the auto " + "configuration!"), TR("Ok")))->Go(); return B_ERROR; } @@ -471,13 +475,13 @@ EthernetSettingsView::_TriggerAutoConfig(const char* device) BMessage reply; status_t status = networkServer.SendMessage(&message, &reply); if (status != B_OK) { - BString errorMessage("Sending auto-config message failed: "); + BString errorMessage(TR("Sending auto-config message failed: ")); errorMessage << strerror(status); - (new BAlert("error", errorMessage.String(), "Ok"))->Go(); + (new BAlert("error", errorMessage.String(), TR("Ok")))->Go(); return status; } else if (reply.FindInt32("status", &status) == B_OK && status != B_OK) { - BString errorMessage("Auto-configuring failed: "); + BString errorMessage(TR("Auto-configuring failed: ")); errorMessage << strerror(status); (new BAlert("error", errorMessage.String(), "Ok"))->Go(); return status; @@ -540,7 +544,7 @@ EthernetSettingsView::MessageReceived(BMessage* message) switch (message->what) { case kMsgMode: if (BMenuItem* item = fTypeMenuField->Menu()->FindMarked()) - _EnableTextControls(strcmp(item->Label(), "DHCP") != 0); + _EnableTextControls(strcmp(item->Label(), TR("DHCP")) != 0); fApplyButton->SetEnabled(true); fRevertButton->SetEnabled(true); break; diff --git a/src/preferences/network/Jamfile b/src/preferences/network/Jamfile index 8098a7a1a3..06a9bea906 100644 --- a/src/preferences/network/Jamfile +++ b/src/preferences/network/Jamfile @@ -9,6 +9,15 @@ Preference Network : EthernetSettingsView.cpp Settings.cpp - : be $(HAIKU_NETWORK_LIBS) $(TARGET_LIBSUPC++) + : be $(HAIKU_NETWORK_LIBS) $(TARGET_LIBSUPC++) liblocale.so : Network.rdef ; + +DoCatalogs Network : + x-vnd.Haiku-Network + : + EthernetSettingsView.cpp + NetworkWindow.cpp + : en.catalog + : fr.catkeys + ; diff --git a/src/preferences/network/NetworkApp.cpp b/src/preferences/network/NetworkApp.cpp index e47942b824..06a21fb052 100644 --- a/src/preferences/network/NetworkApp.cpp +++ b/src/preferences/network/NetworkApp.cpp @@ -15,6 +15,7 @@ NetworkApp::NetworkApp() : BApplication("application/x-vnd.Haiku-Network") { + be_locale->GetAppCatalog(&fCatalog); } NetworkApp::~NetworkApp() diff --git a/src/preferences/network/NetworkApp.h b/src/preferences/network/NetworkApp.h index e74c7a6bcc..3b39bb33ee 100644 --- a/src/preferences/network/NetworkApp.h +++ b/src/preferences/network/NetworkApp.h @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include "NetworkWindow.h" @@ -26,6 +28,7 @@ class NetworkApp : public BApplication { virtual void ReadyToRun(); private: NetworkWindow *fEthWindow; + BCatalog fCatalog; }; diff --git a/src/preferences/network/NetworkWindow.cpp b/src/preferences/network/NetworkWindow.cpp index 932e8d2950..18e5bafacf 100644 --- a/src/preferences/network/NetworkWindow.cpp +++ b/src/preferences/network/NetworkWindow.cpp @@ -9,13 +9,17 @@ #include "NetworkWindow.h" #include +#include #include +#include #include "EthernetSettingsView.h" +#undef TR_CONTEXT +#define TR_CONTEXT "NetworkWindow" NetworkWindow::NetworkWindow() - : BWindow(BRect(50, 50, 269, 302), "Network", B_TITLED_WINDOW, + : BWindow(BRect(50, 50, 269, 302), TR("Network"), B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS) {