Skip to content

Commit 5beaf74

Browse files
committed
* [MOD] Switch base language over to English
1 parent 57f1465 commit 5beaf74

26 files changed

+654
-717
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ crashlytics.properties
4444
crashlytics-build.properties
4545
fabric.properties
4646

47+
tools

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"require": {
2222
"syspass/extension-installer-plugin": "*",
2323
"php": "~7.0 || ~7.1 || ~7.2",
24-
"bacon/bacon-qr-code": "^1.0"
24+
"bacon/bacon-qr-code": "^1.0",
25+
"ext-gettext": "*"
2526
},
2627
"extra": {
2728
"type": "web"

src/lib/Controllers/AuthenticatorController.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ public function saveAction()
9393
if ($this->configData->isDemoEnabled()) {
9494
return $this->returnJsonResponse(
9595
JsonResponse::JSON_WARNING,
96-
_t('authenticator', 'Ey, esto es una DEMO!!')
96+
_t('authenticator', 'Ey, this is a DEMO!!')
9797
);
9898
}
9999

100100
if ($this->trackService->checkTracking($this->trackRequest)) {
101101
$this->addTracking();
102102

103-
throw new AuthenticatorException(__u('Intentos excedidos'));
103+
throw new AuthenticatorException(__u('Attempts exceeded'));
104104
}
105105

106106
if ($this->checkRecoveryCode($pin, $authenticatorData)
@@ -113,7 +113,7 @@ public function saveAction()
113113

114114
return $this->returnJsonResponse(
115115
JsonResponse::JSON_ERROR,
116-
_t('authenticator', 'Código incorrecto')
116+
_t('authenticator', 'Wrong code')
117117
);
118118
} catch (AuthenticatorException $e) {
119119
return $this->returnJsonResponse(
@@ -127,7 +127,7 @@ public function saveAction()
127127

128128
return $this->returnJsonResponse(
129129
JsonResponse::JSON_ERROR,
130-
__u('Error interno'),
130+
__u('Internal error'),
131131
[__u($e->getMessage())]
132132
);
133133
}
@@ -159,7 +159,7 @@ private function checkRecoveryCode($pin, AuthenticatorData $authenticatorData)
159159
) {
160160
$this->eventDispatcher->notifyEvent('authenticator.use.recoverycode',
161161
new Event($this, EventMessage::factory()
162-
->addDescription(_t('authenticator', 'Código de recuperación utilizado')))
162+
->addDescription(_t('authenticator', 'Recovery code used')))
163163
);
164164

165165
return true;
@@ -218,7 +218,7 @@ private function save2FAStatus(AuthenticatorData $authenticatorData)
218218

219219
return $this->returnJsonResponse(
220220
JsonResponse::JSON_SUCCESS,
221-
_t('authenticator', '2FA Habilitado')
221+
_t('authenticator', '2FA Enabled')
222222
);
223223
}
224224

@@ -229,13 +229,13 @@ private function save2FAStatus(AuthenticatorData $authenticatorData)
229229

230230
return $this->returnJsonResponse(
231231
JsonResponse::JSON_SUCCESS,
232-
_t('authenticator', '2FA Deshabilitado')
232+
_t('authenticator', '2FA Disabled')
233233
);
234234
}
235235

236236
return $this->returnJsonResponse(
237237
JsonResponse::JSON_SUCCESS,
238-
__u('Sin cambios')
238+
__u('No changes')
239239
);
240240
}
241241

@@ -260,7 +260,7 @@ public function checkCodeAction()
260260
$this->pluginContext->setTwoFApass(false);
261261
$this->session->setAuthCompleted(false);
262262

263-
throw new AuthenticatorException(__u('Usuario no encontrado'));
263+
throw new AuthenticatorException(__u('User not found'));
264264
}
265265

266266
if ($codeReset
@@ -273,7 +273,7 @@ public function checkCodeAction()
273273

274274
return $this->returnJsonResponse(
275275
JsonResponse::JSON_SUCCESS,
276-
_t('authenticator', 'Email de recuperación enviado')
276+
_t('authenticator', 'Recovery email has been sent')
277277
);
278278
}
279279

@@ -289,15 +289,15 @@ public function checkCodeAction()
289289
return $this->returnJsonResponseData(
290290
['url' => $url],
291291
JsonResponse::JSON_SUCCESS,
292-
_t('authenticator', 'Código correcto')
292+
_t('authenticator', 'Correct code')
293293
);
294294
}
295295

296296
$this->addTracking();
297297

298298
return $this->returnJsonResponse(
299299
JsonResponse::JSON_ERROR,
300-
_t('authenticator', 'Código incorrecto')
300+
_t('authenticator', 'Wrong code')
301301
);
302302
} catch (AuthenticatorException $e) {
303303
return $this->returnJsonResponse(
@@ -311,7 +311,7 @@ public function checkCodeAction()
311311

312312
return $this->returnJsonResponse(
313313
JsonResponse::JSON_ERROR,
314-
__u('Error interno')
314+
__u('Internal error')
315315
);
316316
}
317317
}
@@ -331,13 +331,13 @@ private function sendResetEmail(AuthenticatorData $authenticatorData)
331331
$code = $this->authenticatorService->pickRecoveryCode($authenticatorData);
332332

333333
$message = new MailMessage();
334-
$message->setTitle(_t('authenticator', 'Recuperación de Código 2FA'));
335-
$message->addDescription(_t('authenticator', 'Se ha solicitado un código de recuperación para 2FA.'));
334+
$message->setTitle(_t('authenticator', '2FA Code Recovery'));
335+
$message->addDescription(_t('authenticator', 'A 2FA recovery code has been requested.'));
336336
$message->addDescriptionLine();
337-
$message->addDescription(sprintf(_t('authenticator', 'El código de recuperación es: %s'), $code));
337+
$message->addDescription(sprintf(_t('authenticator', 'The recovery code is: %s'), $code));
338338

339339
$this->dic->get(MailService::class)
340-
->send(_t('authenticator', 'Recuperación de Código 2FA'),
340+
->send(_t('authenticator', '2FA Code Recovery'),
341341
$this->userData->getEmail(),
342342
$message);
343343

@@ -350,7 +350,7 @@ private function sendResetEmail(AuthenticatorData $authenticatorData)
350350

351351
$this->eventDispatcher->notifyEvent('exception', new Event($e));
352352

353-
throw new AuthenticatorException(__u('Error al enviar correo'));
353+
throw new AuthenticatorException(__u('Error while sending the email'));
354354
}
355355
}
356356

@@ -363,22 +363,22 @@ public function showRecoveryCodesAction()
363363
$authenticatorData = $this->plugin->getDataForId($this->userData->getId());
364364

365365
if ($authenticatorData === null) {
366-
throw new AuthenticatorException(__u('Usuario no encontrado'));
366+
throw new AuthenticatorException(__u('User not found'));
367367
}
368368

369369
$codes = $authenticatorData->getRecoveryCodes();
370370

371371
if (count($codes) > 0) {
372372
$this->eventDispatcher->notifyEvent('authenticator.show.recoverycode',
373373
new Event($this, EventMessage::factory()
374-
->addDescription(_t('authenticator', 'Códigos de recuperación visualizados')))
374+
->addDescription(_t('authenticator', 'Recovery codes displayed')))
375375
);
376376

377377
return $this->returnJsonResponseData($codes);
378378
} else {
379379
return $this->returnJsonResponse(
380380
JsonResponse::JSON_ERROR,
381-
_t('authenticator', 'Códigos de recuperación agotados')
381+
_t('authenticator', 'There aren\'t any recovery codes available')
382382
);
383383
}
384384
} catch (\Exception $e) {
@@ -388,7 +388,7 @@ public function showRecoveryCodesAction()
388388

389389
return $this->returnJsonResponse(
390390
JsonResponse::JSON_ERROR,
391-
__u('Error interno')
391+
__u('Internal error')
392392
);
393393
}
394394
}

src/lib/Controllers/AuthenticatorLoginController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ protected function checkExpireTime($userId)
9696
if ($timeRemaining <= self::WARNING_TIME) {
9797
$this->eventDispatcher->notifyEvent('authenticator.expiry.notice',
9898
new Event($this, EventMessage::factory()
99-
->addDescription(_t('authenticator', 'Aviso Caducidad'))
100-
->addDescription(sprintf(_t('authenticator', 'El código 2FA se ha de restablecer en %d días'), $timeRemaining / 86400)))
99+
->addDescription(_t('authenticator', 'Expire Notice'))
100+
->addDescription(sprintf(_t('authenticator', 'The 2FA code will need to be reset within %d days'), $timeRemaining / 86400)))
101101
);
102102
} elseif (time() > $expireTime) {
103103
$this->eventDispatcher->notifyEvent('authenticator.expiry.notice',
104104
new Event($this, EventMessage::factory()
105-
->addDescription(_t('authenticator', 'Aviso Caducidad'))
106-
->addDescription(_t('authenticator', 'El código 2FA ha caducado. Es necesario restablecerlo desde las preferencias')))
105+
->addDescription(_t('authenticator', 'Expire Notice'))
106+
->addDescription(_t('authenticator', 'The 2FA code is expired. You need to reset it on preferences tab')))
107107
);
108108
}
109109
}

src/lib/Controllers/PreferencesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,6 @@ protected function getSecurityTab()
151151
ErrorUtil::showExceptionInView($template, $e, null, false);
152152
}
153153

154-
return new DataTab(_t('authenticator', 'Seguridad'), $template);
154+
return new DataTab(_t('authenticator', 'Security'), $template);
155155
}
156156
}

src/lib/Services/AuthenticatorService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function pickRecoveryCode(AuthenticatorData $authenticatorData)
216216
return $code;
217217
}
218218

219-
throw new AuthenticatorException(_t('authenticator', 'Códigos de recuperación agotados'));
219+
throw new AuthenticatorException(_t('authenticator', 'There aren\'t any recovery codes available'));
220220
}
221221

222222
/**
-104 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)