From cb7f384a723f9c057c54cc46b8cafb1ff9ca1e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ou=C5=A1ek?= <brousek@ics.muni.cz> Date: Wed, 23 Mar 2022 09:41:27 +0100 Subject: [PATCH] feat: translation improvements --- dictionaries/privacyidea.definition.json | 13 ++++++-- dictionaries/privacyidea.translation.json | 23 +++++++++++--- templates/LoginForm.php | 38 ++++++++++++++--------- 3 files changed, 54 insertions(+), 20 deletions(-) diff --git a/dictionaries/privacyidea.definition.json b/dictionaries/privacyidea.definition.json index 7ec13d0..df58b6f 100644 --- a/dictionaries/privacyidea.definition.json +++ b/dictionaries/privacyidea.definition.json @@ -17,8 +17,17 @@ "otp": { "en": "OTP" }, + "webauthn": { + "en": "WebAuthn" + }, + "push": { + "en": "Push" + }, + "u2f": { + "en": "U2F" + }, "login_title_challenge": { - "en": "Please enter your One Time Password" + "en": "Multi-factor authentication" }, "otp_extra_text": { "en": "Please enter your Password and One Time Password" @@ -66,6 +75,6 @@ "en": "Verification was not successful. Please try again." }, "error": { - "en": "Error " + "en": "Error" } } diff --git a/dictionaries/privacyidea.translation.json b/dictionaries/privacyidea.translation.json index b74df65..cebf65a 100644 --- a/dictionaries/privacyidea.translation.json +++ b/dictionaries/privacyidea.translation.json @@ -24,10 +24,25 @@ "de": "Einmalpasswort", "nl": "OTP" }, + "webauthn": { + "cs": "WebAuthn", + "de": "WebAuthn", + "nl": "WebAuthn" + }, + "push": { + "cs": "push notifikace", + "de": "Push", + "nl": "Push" + }, + "u2f": { + "cs": "U2F", + "de": "U2F", + "nl": "U2F" + }, "login_title_challenge": { - "cs": "VloĹľte jednorázovĂ˝ kĂłd", - "de": "Bitte geben Sie Ihr Einmalpasswort ein", - "nl": "Vul je eenmalige wachtwoord in." + "cs": "VĂcefázovĂ© ověřenĂ", + "de": "Multi-Faktor-Authentisierung", + "nl": "Multifactorauthenticatie" }, "otp_extra_text": { "cs": "VloĹľte svĂ© heslo a jednorázovĂ˝ kĂłd", @@ -90,6 +105,6 @@ "cs": "OvěřenĂ nebylo ĂşspěšnĂ©. Zkuste to znovu nebo pouĹľijte jinou metodu." }, "error": { - "cs": "Chyba " + "cs": "Chyba" } } diff --git a/templates/LoginForm.php b/templates/LoginForm.php index 0ba5d5b..93bb007 100644 --- a/templates/LoginForm.php +++ b/templates/LoginForm.php @@ -43,16 +43,22 @@ if (null !== $this->data['errorCode']) { ?> <div class="error-dialog"> - <img src="/<?php echo htmlspecialchars( + <img src="/<?php + echo htmlspecialchars( $this->data['baseurlpath'], ENT_QUOTES ); ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l erroricon" alt="gtk-dialog-error"/> <h2><?php echo $this->t('{login:error_header}'); ?></h2> <p> - <strong><?php echo htmlspecialchars( - $this->t('{privacyidea:privacyidea:error}') . $this->data['errorCode'] . ': ' . $this->data['errorMessage'] - ); ?></strong> + <strong> + <?php + echo htmlspecialchars( + sprintf('%s%s: %s', $this->t( + '{privacyidea:privacyidea:error}' + ), $this->data['errorCode'] ? (' ' . $this->data['errorCode']) : '', $this->data['errorMessage']) + ); ?> + </strong> </p> </div> @@ -62,15 +68,11 @@ if (null !== $this->data['errorCode']) { <div class="container"> <div class="login"> - <div class="loginlogo"></div> - <?php if ($this->data['authProcFilterScenario']) { echo '<h2>' . htmlspecialchars($this->t('{privacyidea:privacyidea:login_title_challenge}')) . '</h2>'; - } else { - if ($this->data['step'] < 2) { - echo '<h2>' . htmlspecialchars($this->t('{privacyidea:privacyidea:login_title}')) . '</h2>'; - } + } elseif ($this->data['step'] < 2) { + echo '<h2>' . htmlspecialchars($this->t('{privacyidea:privacyidea:login_title}')) . '</h2>'; } ?> @@ -231,10 +233,18 @@ if (null !== $this->data['errorCode']) { <div id="AlternateLoginOptions" class="groupMargin"> <h3><?php echo $this->t('{privacyidea:privacyidea:alternate_login_options}'); ?></h3> <!-- Alternate Login Options--> - <input id="useWebAuthnButton" name="useWebAuthnButton" type="button" value="WebAuthn"/> - <input id="usePushButton" name="usePushButton" type="button" value="Push"/> - <input id="useOTPButton" name="useOTPButton" type="button" value="OTP"/> - <input id="useU2FButton" name="useU2FButton" type="button" value="U2F"/> + <button id="useWebAuthnButton" name="useWebAuthnButton" type="button"> + <span><?php echo $this->t('{privacyidea:privacyidea:webauthn}'); ?></span> + </button> + <button id="usePushButton" name="usePushButton" type="button"> + <span><?php echo $this->t('{privacyidea:privacyidea:push}'); ?></span> + </button> + <button id="useOTPButton" name="useOTPButton" type="button"> + <span><?php echo $this->t('{privacyidea:privacyidea:otp}'); ?></span> + </button> + <button id="useU2FButton" name="useU2FButton" type="button"> + <span><?php echo $this->t('{privacyidea:privacyidea:u2f}'); ?></span> + </button> </div> <br> </form> -- GitLab