Skip to content

Commit 73af217

Browse files
author
Dave MacFarlane
committed
Fix Translations
1 parent 559675c commit 73af217

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

modules/my_preferences/jsx/mfa.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function genPotentialSecret() {
2929
function CodeValidator(props: {
3030
secret: string
3131
}): React.ReactElement {
32+
const {t} = useTranslation();
3233
const formSubmit = useCallback(
3334
(code: string, onError: (msg: string) => void) => {
3435
const formObject = new FormData();
@@ -46,7 +47,12 @@ function CodeValidator(props: {
4647
return resp.json();
4748
}).then( (json) => {
4849
if (json.ok == 'success') {
49-
swal.fire('Success!', json.message, 'success').then( () => {
50+
swal.fire({
51+
title: t('Success!', {ns: 'loris'}),
52+
text: json.message,
53+
type: 'success',
54+
confirmButtonText: t('OK', {ns: 'loris'}),
55+
}).then( () => {
5056
window.location.href = loris.BaseURL + '/my_preferences/';
5157
});
5258
} else if (json.error) {
@@ -60,7 +66,7 @@ function CodeValidator(props: {
6066
}, [props.secret]);
6167
return (
6268
<div>
63-
<h3>Validate Code</h3>
69+
<h3>{t('Validate Code', {ns: 'my_preferences'})}</h3>
6470
<MFAPrompt validate={formSubmit} />
6571
</div>
6672
);
@@ -92,13 +98,16 @@ function MFAIndex(): React.ReactElement {
9298
</Modal>
9399
<p>{t('Scan the following QR code below in your MFA authenticator and enter the code to validate.', {ns: 'my_preferences'})}</p>
94100
<p>
95-
<b>Note that this will <i>overwrite</i> any previously
96-
setup MFA in LORIS!</b>
101+
<strong><Trans
102+
ns="my_preferences"
103+
components={[<strong>overwrite</strong>]}
104+
defaults="Note that this will <0>overwrite</0> any previously setup MFA in LORIS!" /></strong>
97105
</p>
98106
<QRCode value={mfaUrl} />
99-
<p>Can't scan the QR code? <a href="#" onClick={() => setShowModal(true)}>
100-
Setup manually.</a>
101-
</p>
107+
<p><Trans
108+
ns="my_preferences"
109+
defaults="Can't scan the QR code? <0>Setup manually.</0>"
110+
components={[<a href="#" onClick={() => setShowModal(true)} />]} /></p>
102111
<CodeValidator secret={key} />
103112
</div>;
104113
}

modules/my_preferences/locale/ja/LC_MESSAGES/my_preferences.po

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,15 @@ msgstr "認証アプリで次のコードを使用してください: <0>{{code}
6666

6767
msgid "Scan the following QR code below in your MFA authenticator and enter the code to validate."
6868
msgstr "多要素認証システムで以下の QR コードをスキャンし、コードを入力して検証します。"
69+
70+
msgid "Note that this will <0>overwrite</0> any previously setup MFA in LORIS!"
71+
msgstr "これにより、ロリスで以前に設定された多要素認証が <0>上書き</0> されることに注意してください。"
72+
73+
msgid "Can't scan the QR code? <0>Setup manually.</0>"
74+
msgstr "QR コードをスキャンできませんか? <0>手動で設定してください。</0>"
75+
76+
msgid "Validate Code"
77+
msgstr "コードの検証"
78+
79+
msgid "Successfully registered multifactor authenticator"
80+
msgstr "多要素認証の登録に成功しました"

modules/my_preferences/php/mfa.class.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class MFA extends \NDB_Page
112112
$login->setPassedMFA();
113113
return new \LORIS\Http\Response\JSON\OK(
114114
['ok' => 'success',
115-
'message' => 'Successfully registered multifactor authenticator'
115+
'message' => dgettext('my_preferences', 'Successfully registered multifactor authenticator')
116116
]
117117
);
118118
}

0 commit comments

Comments
 (0)