Skip to content

Commit 2509634

Browse files
author
Saket Hatwar
committed
additional translations
1 parent 2cdf78a commit 2509634

File tree

5 files changed

+156
-34
lines changed

5 files changed

+156
-34
lines changed

locale/hi/LC_MESSAGES/loris.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ msgstr "रिपोर्ट्स"
113113
msgid "TimePoint"
114114
msgstr "समय बिंदु"
115115

116+
msgid "Module"
117+
msgstr "मॉड्यूल"
118+
116119
# Common select option labels
117120
msgid "Yes"
118121
msgstr "हाँ"

locale/loris.pot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ msgstr ""
112112
msgid "TimePoint"
113113
msgstr ""
114114

115+
msgid "Module"
116+
msgstr ""
117+
115118
# Common select option labels
116119
msgid "Yes"
117120
msgstr ""

modules/my_preferences/locale/hi/LC_MESSAGES/my_preferences.po

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ msgid "My Preferences"
2222
msgstr "मेरी प्राथमिकताएँ"
2323

2424
msgid "Password Rules"
25-
msgstr "पासवर्ड के नियम"
25+
msgstr "पासवर्ड नियम"
2626

2727
msgid "The password must be at least 8 characters long."
2828
msgstr "पासवर्ड कम से कम 8 अक्षरों का होना चाहिए।"
@@ -31,16 +31,76 @@ msgid "The password cannot be your username or email address."
3131
msgstr "पासवर्ड आपका उपयोगकर्ता नाम या ईमेल पता नहीं हो सकता।"
3232

3333
msgid "No special characters are required but your password must be sufficiently complex to be accepted."
34-
msgstr "कोई विशेष अक्षर आवश्यक नहीं हैं, लेकिन पासवर्ड पर्याप्त जटिल होना चाहिए ताकि स्वीकार किया जा सके।"
34+
msgstr "कोई विशेष अक्षर आवश्यक नहीं हैं, लेकिन पासवर्ड पर्याप्त जटिल होना चाहिए ताकि उसे स्वीकार किया जा सके।"
3535

3636
msgid "Please choose a unique password."
3737
msgstr "कृपया एक अद्वितीय पासवर्ड चुनें।"
3838

3939
msgid "We suggest using a password manager to generate one for you."
40-
msgstr "हम सुझाव देते हैं कि आपके लिए पासवर्ड बनाने के लिए पासवर्ड प्रबंधक का उपयोग करें।"
40+
msgstr "हम सुझाव देते हैं कि आपके लिए पासवर्ड बनाने हेतु पासवर्ड मैनेजर का उपयोग करें।"
4141

4242
msgid "Edit My Information"
4343
msgstr "मेरी जानकारी संपादित करें"
4444

4545
msgid "Notifications"
4646
msgstr "सूचनाएँ"
47+
48+
msgid "User name"
49+
msgstr "उपयोगकर्ता नाम"
50+
51+
msgid "First name"
52+
msgstr "पहला नाम"
53+
54+
msgid "First name is required and should not exceed 120 characters"
55+
msgstr "पहला नाम आवश्यक है और 120 अक्षरों से अधिक नहीं होना चाहिए।"
56+
57+
msgid "Last name"
58+
msgstr "अंतिम नाम"
59+
60+
msgid "Last name is required and should not exceed 120 characters"
61+
msgstr "अंतिम नाम आवश्यक है और 120 अक्षरों से अधिक नहीं होना चाहिए।"
62+
63+
msgid "Email address"
64+
msgstr "ईमेल पता"
65+
66+
msgid "Email address is required"
67+
msgstr "ईमेल पता आवश्यक है"
68+
69+
msgid "Your email address must be less than 255 characters long"
70+
msgstr "आपका ईमेल पता 255 अक्षरों से कम होना चाहिए।"
71+
72+
msgid "New Password"
73+
msgstr "नया पासवर्ड"
74+
75+
msgid "Confirm Password"
76+
msgstr "पासवर्ड की पुष्टि करें"
77+
78+
msgid "Language preference"
79+
msgstr "भाषा वरीयता"
80+
81+
msgid "Operation"
82+
msgstr "क्रिया"
83+
84+
msgid "Description"
85+
msgstr "विवरण"
86+
87+
msgid "N/A"
88+
msgstr "लागू नहीं"
89+
90+
msgid "Invalid email address"
91+
msgstr "अमान्य ईमेल पता"
92+
93+
msgid "The email address already exists"
94+
msgstr "ईमेल पता पहले से मौजूद है"
95+
96+
msgid "Your password cannot be your email."
97+
msgstr "आपका पासवर्ड आपका ईमेल नहीं हो सकता।"
98+
99+
msgid "Your password cannot be your user name."
100+
msgstr "आपका पासवर्ड आपका उपयोगकर्ता नाम नहीं हो सकता।"
101+
102+
msgid "The passwords do not match."
103+
msgstr "पासवर्ड मेल नहीं खाते।"
104+
105+
msgid "New and old passwords are identical: please choose another one"
106+
msgstr "नया और पुराना पासवर्ड समान हैं: कृपया कोई और चुनें।"

modules/my_preferences/locale/my_preferences.pot

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,63 @@ msgstr ""
4444

4545
msgid "Notifications"
4646
msgstr ""
47+
48+
msgid "User name"
49+
msgstr ""
50+
51+
msgid "First name"
52+
msgstr ""
53+
54+
msgid "First name is required and should not exceed 120 characters"
55+
msgstr ""
56+
57+
msgid "Last name"
58+
msgstr ""
59+
60+
msgid "Last name is required and should not exceed 120 characters"
61+
msgstr ""
62+
63+
msgid "Email address"
64+
msgstr ""
65+
66+
msgid "Email address is required"
67+
msgstr ""
68+
69+
msgid "Your email address must be less than 255 characters long"
70+
msgstr ""
71+
72+
msgid "New Password"
73+
msgstr ""
74+
75+
msgid "Confirm Password"
76+
msgstr ""
77+
78+
msgid "Language preference"
79+
msgstr ""
80+
81+
msgid "Operation"
82+
msgstr ""
83+
84+
msgid "Description"
85+
msgstr ""
86+
87+
msgid "N/A"
88+
msgstr ""
89+
90+
msgid "Invalid email address"
91+
msgstr ""
92+
93+
msgid "The email address already exists"
94+
msgstr ""
95+
96+
msgid "Your password cannot be your email."
97+
msgstr ""
98+
99+
msgid "Your password cannot be your user name."
100+
msgstr ""
101+
102+
msgid "The passwords do not match."
103+
msgstr ""
104+
105+
msgid "New and old passwords are identical: please choose another one"
106+
msgstr ""

modules/my_preferences/php/my_preferences.class.inc

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ namespace LORIS\my_preferences;
99
*/
1010
class My_Preferences extends \NDB_Form
1111
{
12+
// Use gettext for error messages
1213
private const PASSWORD_ERROR_IS_EMAIL = 'Your password cannot be your email.';
13-
private const PASSWORD_ERROR_IS_USER = 'Your password cannot be ' .
14-
'your user name.';
14+
private const PASSWORD_ERROR_IS_USER = 'Your password cannot be your user name.';
1515
private const PASSWORD_ERROR_NO_MATCH = 'The passwords do not match.';
16-
private const PASSWORD_ERROR_NO_CHANGE = 'New and old passwords are ' .
17-
'identical: please choose another one';
16+
private const PASSWORD_ERROR_NO_CHANGE = 'New and old passwords are identical: please choose another one';
1817

1918
/**
2019
* Computes the initial values this page will be filled with.
@@ -223,21 +222,19 @@ class My_Preferences extends \NDB_Form
223222
//get notification details
224223
$notifier_list = \NDB_Notifier::getNotificationModuleServices();
225224
$notifier_services = \NDB_Notifier::getNotificationServices();
226-
//------------------------------------------------------------
227225

228226
// user name
229-
$this->addScoreColumn('UserID', 'User name');
227+
$this->addScoreColumn('UserID', dgettext('my_preferences', 'User name'));
230228

231229
// full name
232230
// The supplied pattern is:
233231
// - must have at least one non-whitespace characters (i.e. required)
234232
// - once leading and trailing spaces are stripped, the field should
235233
// not exceed 120 chars
236-
$firstNameInvalidMsg = "First name is required and "
237-
. "should not exceed 120 characters";
234+
$firstNameInvalidMsg = dgettext('my_preferences', "First name is required and should not exceed 120 characters");
238235
$this->addBasicText(
239236
'First_name',
240-
'First name',
237+
dgettext('my_preferences', 'First name'),
241238
[],
242239
[
243240
'oninvalid' => "this.setCustomValidity('$firstNameInvalidMsg')",
@@ -250,11 +247,10 @@ class My_Preferences extends \NDB_Form
250247
// - must have at least one non-whitespace characters (i.e. required)
251248
// - once leading and trailing spaces are stripped, the field should
252249
// not exceed 120 chars
253-
$lastNameInvalidMsg = "Last name is required and "
254-
. "should not exceed 120 characters";
250+
$lastNameInvalidMsg = dgettext('my_preferences', "Last name is required and should not exceed 120 characters");
255251
$this->addBasicText(
256252
'Last_name',
257-
'Last name',
253+
dgettext('my_preferences', 'Last name'),
258254
[],
259255
[
260256
'oninvalid' => "this.setCustomValidity('$lastNameInvalidMsg')",
@@ -267,36 +263,36 @@ class My_Preferences extends \NDB_Form
267263
// email address
268264
$this->addBasicText(
269265
'Email',
270-
'Email address',
266+
dgettext('my_preferences', 'Email address'),
271267
[],
272268
[
273-
'oninvalid' => "this.setCustomValidity('Email address is required')",
269+
'oninvalid' => "this.setCustomValidity('" . dgettext('my_preferences', 'Email address is required') . "')",
274270
'onchange' => "this.setCustomValidity('')",
275271
]
276272
);
277273

278274
// email address rules
279-
$this->addRule('Email', 'Email address is required', 'required');
275+
$this->addRule('Email', dgettext('my_preferences', 'Email address is required'), 'required');
280276
$this->addRule(
281277
'Email',
282-
'Your email address must be less than 255 characters long',
278+
dgettext('my_preferences', 'Your email address must be less than 255 characters long'),
283279
'maxlength',
284280
"255"
285281
);
286282

287283
// password
288-
$this->form->addElement('password', 'Password_hash', 'New Password');
289-
$this->form->addElement('password', '__Confirm', 'Confirm Password');
284+
$this->form->addElement('password', 'Password_hash', dgettext('my_preferences', 'New Password'));
285+
$this->form->addElement('password', '__Confirm', dgettext('my_preferences', 'Confirm Password'));
290286

291287
// language preference
292288
$languages = \Utility::getLanguageList();
293-
$this->addSelect('language_preference', 'Language preference', $languages);
289+
$this->addSelect('language_preference', dgettext('my_preferences', 'Language preference'), $languages);
294290

295291
// Notification headers
296292
$nGroup = [];
297-
$nGroup[] = $this->createLabel("Module");
298-
$nGroup[] = $this->createLabel("Operation");
299-
$nGroup[] = $this->createLabel("Description");
293+
$nGroup[] = $this->createLabel(dgettext('my_preferences', "Module"));
294+
$nGroup[] = $this->createLabel(dgettext('my_preferences', "Operation"));
295+
$nGroup[] = $this->createLabel(dgettext('my_preferences', "Description"));
300296

301297
foreach ($notifier_services as $serv) {
302298
$nGroup[] = $this->createLabel($serv);
@@ -337,7 +333,7 @@ class My_Preferences extends \NDB_Form
337333
);
338334
} else {
339335
$nGroup[] = $this->createLabel(
340-
"N/A"
336+
dgettext('my_preferences', "N/A")
341337
);
342338
}
343339

@@ -397,18 +393,18 @@ class My_Preferences extends \NDB_Form
397393
$plaintext = $values['Password_hash'];
398394

399395
if ($values['Email'] === $plaintext) {
400-
$errors['Password_Group'] = self::PASSWORD_ERROR_IS_EMAIL;
396+
$errors['Password_Group'] = dgettext('my_preferences', self::PASSWORD_ERROR_IS_EMAIL);
401397
}
402398

403399
// Make sure the user is not using their username as their password.
404400
if ($this->identifier === $plaintext) {
405-
$errors['Password_Group'] = self::PASSWORD_ERROR_IS_USER;
401+
$errors['Password_Group'] = dgettext('my_preferences', self::PASSWORD_ERROR_IS_USER);
406402
}
407403

408404
// Ensure that the password and confirm password fields match.
409405
// TODO This validation should be done on the front-end instead.
410406
if ($values['Password_hash'] !== $values['__Confirm']) {
411-
$errors['Password_Group'] = self::PASSWORD_ERROR_NO_MATCH;
407+
$errors['Password_Group'] = dgettext('my_preferences', self::PASSWORD_ERROR_NO_MATCH);
412408
return $errors;
413409
}
414410

@@ -425,17 +421,17 @@ class My_Preferences extends \NDB_Form
425421
$decoded
426422
)
427423
) {
428-
$errors['Password_Group'] = self::PASSWORD_ERROR_NO_CHANGE;
424+
$errors['Password_Group'] = dgettext('my_preferences', self::PASSWORD_ERROR_NO_CHANGE);
429425
}
430426
} catch (\InvalidArgumentException $e) {
431-
$errors['Password_Group'] = $e->getMessage();
427+
$errors['Password_Group'] = dgettext('my_preferences', $e->getMessage());
432428
}
433429
}
434430

435431
// Validate email
436432
$emailError = $this->_getEmailError($DB, $values['Email']);
437433
if (!is_null($emailError)) {
438-
$errors['Email'] = $emailError;
434+
$errors['Email'] = dgettext('my_preferences', $emailError);
439435
}
440436

441437
return $errors;
@@ -456,7 +452,7 @@ class My_Preferences extends \NDB_Form
456452
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
457453
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
458454
// If email not syntactically valid
459-
return "Invalid email address";
455+
return dgettext('my_preferences', "Invalid email address");
460456
}
461457

462458
// check email address' uniqueness
@@ -470,7 +466,7 @@ class My_Preferences extends \NDB_Form
470466

471467
// Email already exists in database
472468
if ($result > 0) {
473-
return 'The email address already exists';
469+
return dgettext('my_preferences', 'The email address already exists');
474470
}
475471

476472
return null;

0 commit comments

Comments
 (0)