@@ -27,7 +27,7 @@ Networking::Networking(QWidget* parent, bool show_advanced) : QFrame(parent) {
2727  QVBoxLayout* vlayout = new  QVBoxLayout (wifiScreen);
2828  vlayout->setContentsMargins (20 , 20 , 20 , 20 );
2929  if  (show_advanced) {
30-     QPushButton* advancedSettings = new  QPushButton (" Advanced"  );
30+     QPushButton* advancedSettings = new  QPushButton (tr ( " Advanced" ) );
3131    advancedSettings->setObjectName (" advanced_btn"  );
3232    advancedSettings->setStyleSheet (" margin-right: 30px;"  );
3333    advancedSettings->setFixedSize (400 , 100 );
@@ -84,7 +84,7 @@ void Networking::connectToNetwork(const Network &n) {
8484  } else  if  (n.security_type  == SecurityType::OPEN) {
8585    wifi->connect (n);
8686  } else  if  (n.security_type  == SecurityType::WPA) {
87-     QString pass = InputDialog::getText (" Enter password"  , this , " for \" "   + n.ssid  + " \" "  , true , 8 );
87+     QString pass = InputDialog::getText (tr ( " Enter password" ) , this , tr ( " for \" " )  + n.ssid  + " \" "  , true , 8 );
8888    if  (!pass.isEmpty ()) {
8989      wifi->connect (n, pass);
9090    }
@@ -94,7 +94,7 @@ void Networking::connectToNetwork(const Network &n) {
9494void  Networking::wrongPassword (const  QString &ssid) {
9595  if  (wifi->seenNetworks .contains (ssid)) {
9696    const  Network &n = wifi->seenNetworks .value (ssid);
97-     QString pass = InputDialog::getText (" Wrong password"  , this , " for \" "   + n.ssid  +" \" "  , true , 8 );
97+     QString pass = InputDialog::getText (tr ( " Wrong password" ) , this , tr ( " for \" " )  + n.ssid  +" \" "  , true , 8 );
9898    if  (!pass.isEmpty ()) {
9999      wifi->connect (n, pass);
100100    }
@@ -118,30 +118,30 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
118118  main_layout->setSpacing (20 );
119119
120120  //  Back button
121-   QPushButton* back = new  QPushButton (" Back"  );
121+   QPushButton* back = new  QPushButton (tr ( " Back" ) );
122122  back->setObjectName (" back_btn"  );
123123  back->setFixedSize (400 , 100 );
124124  connect (back, &QPushButton::clicked, [=]() { emit backPress (); });
125125  main_layout->addWidget (back, 0 , Qt::AlignLeft);
126126
127127  ListWidget *list = new  ListWidget (this );
128128  //  Enable tethering layout
129-   tetheringToggle = new  ToggleControl (" Enable Tethering"  , " "  , " "  , wifi->isTetheringEnabled ());
129+   tetheringToggle = new  ToggleControl (tr ( " Enable Tethering" ) , " "  , " "  , wifi->isTetheringEnabled ());
130130  list->addItem (tetheringToggle);
131131  QObject::connect (tetheringToggle, &ToggleControl::toggleFlipped, this , &AdvancedNetworking::toggleTethering);
132132
133133  //  Change tethering password
134-   ButtonControl *editPasswordButton = new  ButtonControl (" Tethering Password" ,  " EDIT"  );
134+   ButtonControl *editPasswordButton = new  ButtonControl (tr ( " Tethering Password" ),  tr ( " EDIT" ) );
135135  connect (editPasswordButton, &ButtonControl::clicked, [=]() {
136-     QString pass = InputDialog::getText (" Enter new tethering password"  , this , " "  , true , 8 , wifi->getTetheringPassword ());
136+     QString pass = InputDialog::getText (tr ( " Enter new tethering password" ) , this , " "  , true , 8 , wifi->getTetheringPassword ());
137137    if  (!pass.isEmpty ()) {
138138      wifi->changeTetheringPassword (pass);
139139    }
140140  });
141141  list->addItem (editPasswordButton);
142142
143143  //  IP address
144-   ipLabel = new  LabelControl (" IP Address"  , wifi->ipv4_address );
144+   ipLabel = new  LabelControl (tr ( " IP Address" ) , wifi->ipv4_address );
145145  list->addItem (ipLabel);
146146
147147  //  SSH keys
@@ -150,19 +150,19 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
150150
151151  //  Roaming toggle
152152  const  bool  roamingEnabled = params.getBool (" GsmRoaming"  );
153-   ToggleControl *roamingToggle = new  ToggleControl (" Enable Roaming"  , " "  , " "  , roamingEnabled);
153+   ToggleControl *roamingToggle = new  ToggleControl (tr ( " Enable Roaming" ) , " "  , " "  , roamingEnabled);
154154  QObject::connect (roamingToggle, &SshToggle::toggleFlipped, [=](bool  state) {
155155    params.putBool (" GsmRoaming"  , state);
156156    wifi->updateGsmSettings (state, QString::fromStdString (params.get (" GsmApn"  )));
157157  });
158158  list->addItem (roamingToggle);
159159
160160  //  APN settings
161-   ButtonControl *editApnButton = new  ButtonControl (" APN Setting" ,  " EDIT"  );
161+   ButtonControl *editApnButton = new  ButtonControl (tr ( " APN Setting" ),  tr ( " EDIT" ) );
162162  connect (editApnButton, &ButtonControl::clicked, [=]() {
163163    const  bool  roamingEnabled = params.getBool (" GsmRoaming"  );
164164    const  QString cur_apn = QString::fromStdString (params.get (" GsmApn"  ));
165-     QString apn = InputDialog::getText (" Enter APN"  , this , " leave blank for automatic configuration"  , false , -1 , cur_apn).trimmed ();
165+     QString apn = InputDialog::getText (tr ( " Enter APN" ) , this , tr ( " leave blank for automatic configuration" ) , false , -1 , cur_apn).trimmed ();
166166
167167    if  (apn.isEmpty ()) {
168168      params.remove (" GsmApn"  );
@@ -207,7 +207,7 @@ WifiUI::WifiUI(QWidget *parent, WifiManager* wifi) : QWidget(parent), wifi(wifi)
207207  checkmark = QPixmap (ASSET_PATH + " offroad/icon_checkmark.svg"  ).scaledToWidth (49 , Qt::SmoothTransformation);
208208  circled_slash = QPixmap (ASSET_PATH + " img_circled_slash.svg"  ).scaledToWidth (49 , Qt::SmoothTransformation);
209209
210-   QLabel *scanning = new  QLabel (" Scanning for networks..."  );
210+   QLabel *scanning = new  QLabel (tr ( " Scanning for networks..." ) );
211211  scanning->setStyleSheet (" font-size: 65px;"  );
212212  main_layout->addWidget (scanning, 0 , Qt::AlignCenter);
213213
@@ -260,7 +260,7 @@ void WifiUI::refresh() {
260260  clearLayout (main_layout);
261261
262262  if  (wifi->seenNetworks .size () == 0 ) {
263-     QLabel *scanning = new  QLabel (" Scanning for networks..."  );
263+     QLabel *scanning = new  QLabel (tr ( " Scanning for networks..." ) );
264264    scanning->setStyleSheet (" font-size: 65px;"  );
265265    main_layout->addWidget (scanning, 0 , Qt::AlignCenter);
266266    return ;
@@ -286,17 +286,17 @@ void WifiUI::refresh() {
286286    hlayout->addWidget (ssidLabel, network.connected  == ConnectedType::CONNECTING ? 0  : 1 );
287287
288288    if  (network.connected  == ConnectedType::CONNECTING) {
289-       QPushButton *connecting = new  QPushButton (" CONNECTING..."  );
289+       QPushButton *connecting = new  QPushButton (tr ( " CONNECTING..." ) );
290290      connecting->setObjectName (" connecting"  );
291291      hlayout->addWidget (connecting, 2 , Qt::AlignLeft);
292292    }
293293
294294    //  Forget button
295295    if  (wifi->isKnownConnection (network.ssid ) && !wifi->isTetheringEnabled ()) {
296-       QPushButton *forgetBtn = new  QPushButton (" FORGET"  );
296+       QPushButton *forgetBtn = new  QPushButton (tr ( " FORGET" ) );
297297      forgetBtn->setObjectName (" forgetBtn"  );
298298      QObject::connect (forgetBtn, &QPushButton::clicked, [=]() {
299-         if  (ConfirmationDialog::confirm (" Forget Wi-Fi Network \" "   + QString::fromUtf8 (network.ssid ) + " \" ?"  , this )) {
299+         if  (ConfirmationDialog::confirm (tr ( " Forget Wi-Fi Network \" " )  + QString::fromUtf8 (network.ssid ) + " \" ?"  , this )) {
300300          wifi->forgetConnection (network.ssid );
301301        }
302302      });
0 commit comments