- Localization of network preflet done by mt. Thanks !

- French translation by me.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34013 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2009-11-12 20:36:06 +00:00
parent 6c00aabc9e
commit a2e177e884
6 changed files with 60 additions and 22 deletions

View File

@ -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

View File

@ -18,11 +18,13 @@
#include <Alert.h>
#include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <CheckBox.h>
#include <File.h>
#include <GridView.h>
#include <GroupView.h>
#include <LayoutItem.h>
#include <Locale.h>
#include <Slider.h>
#include <SpaceLayoutItem.h>
#include <StringView.h>
@ -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;

View File

@ -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
;

View File

@ -15,6 +15,7 @@
NetworkApp::NetworkApp()
: BApplication("application/x-vnd.Haiku-Network")
{
be_locale->GetAppCatalog(&fCatalog);
}
NetworkApp::~NetworkApp()

View File

@ -15,6 +15,8 @@
#include <stdlib.h>
#include <unistd.h>
#include <Application.h>
#include <Catalog.h>
#include <Locale.h>
#include "NetworkWindow.h"
@ -26,6 +28,7 @@ class NetworkApp : public BApplication {
virtual void ReadyToRun();
private:
NetworkWindow *fEthWindow;
BCatalog fCatalog;
};

View File

@ -9,13 +9,17 @@
#include "NetworkWindow.h"
#include <Application.h>
#include <Catalog.h>
#include <GroupLayout.h>
#include <Locale.h>
#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)
{