Skip to content

Commit aa3ba31

Browse files
author
Saket Hatwar
committed
fixes
1 parent 618200c commit aa3ba31

File tree

3 files changed

+69
-13
lines changed

3 files changed

+69
-13
lines changed

modules/user_accounts/locale/hi/LC_MESSAGES/user_accounts.po

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ msgstr "नोट्स"
5454
msgid "It is recommended to use an email address as the username, for clarity and uniqueness."
5555
msgstr "स्पष्टता और अद्वितीयता के लिए उपयोगकर्ता नाम के रूप में ईमेल पते का उपयोग करने की अनुशंसा की जाती है।"
5656

57-
msgid "When generating a new password, please notify the user by checking 'Send email to user' box below!"
58-
msgstr "नया पासवर्ड बनाते समय, कृपया नीचे 'उपयोगकर्ता को ईमेल भेजें' बॉक्स को चेक करके उपयोगकर्ता को सूचित करें!"
57+
msgid "When generating a new password, please notify the user by checking 'Send email to user' box"
58+
msgstr "नया पासवर्ड बनाते समय, कृपया 'उपयोगकर्ता को ईमेल भेजें' बॉक्स को चुनकर उपयोगकर्ता को सूचित करें।"
59+
60+
msgid "You must leave the password field empty if you want the system to generate one for you"
61+
msgstr "यदि आप चाहते हैं कि सिस्टम आपके लिए पासवर्ड बनाए, तो पासवर्ड फ़ील्ड खाली छोड़ना आवश्यक है।"
5962

6063
msgid "Add/Edit User"
6164
msgstr "उपयोगकर्ता जोड़ें/संपादित करें"
@@ -173,3 +176,18 @@ msgstr "कृपया कम से कम एक परीक्षक स्
173176

174177
msgid "Please notice that the \"Active from\" date should be lesser or equal to the \"Active to\" date."
175178
msgstr "कृपया ध्यान दें कि 'सक्रिय शुरू' तिथि, 'सक्रिय समाप्त' तिथि के बराबर या उससे पहले होनी चाहिए।"
179+
180+
msgid "Your password cannot be your email."
181+
msgstr "आपका पासवर्ड आपका ईमेल नहीं हो सकता।"
182+
183+
msgid "Your password cannot be your user name."
184+
msgstr "आपका पासवर्ड आपका उपयोगकर्ता नाम नहीं हो सकता।"
185+
186+
msgid "The passwords do not match."
187+
msgstr "पासवर्ड मेल नहीं खाते।"
188+
189+
msgid "New and old passwords are identical"
190+
msgstr "नया और पुराना पासवर्ड समान हैं।"
191+
192+
msgid "This email address is already in use"
193+
msgstr "यह ईमेल पता पहले से उपयोग में है।"

modules/user_accounts/locale/user_accounts.pot

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ msgstr ""
5454
msgid "It is recommended to use an email address as the username, for clarity and uniqueness."
5555
msgstr ""
5656

57-
msgid "When generating a new password, please notify the user by checking 'Send email to user' box below!"
57+
msgid "When generating a new password, please notify the user by checking 'Send email to user' box"
58+
msgstr ""
59+
60+
msgid "You must leave the password field empty if you want the system to generate one for you"
5861
msgstr ""
5962

6063
msgid "Add/Edit User"
@@ -173,3 +176,18 @@ msgstr ""
173176

174177
msgid "Please notice that the \"Active from\" date should be lesser or equal to the \"Active to\" date."
175178
msgstr ""
179+
180+
msgid "Your password cannot be your email."
181+
msgstr ""
182+
183+
msgid "Your password cannot be your user name."
184+
msgstr ""
185+
186+
msgid "The passwords do not match."
187+
msgstr ""
188+
189+
msgid "New and old passwords are identical"
190+
msgstr ""
191+
192+
msgid "This email address is already in use"
193+
msgstr ""

modules/user_accounts/php/edit_user.class.inc

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,10 @@ class Edit_User extends \NDB_Form
12471247
if ($values['Email'] === $values['Password_hash']
12481248
&& $values['Password_hash'] !== ''
12491249
) {
1250-
$errors['Password'] = self::PASSWORD_ERROR_IS_EMAIL;
1250+
$errors['Password'] = dgettext(
1251+
"user_accounts",
1252+
"Your password cannot be your email."
1253+
);
12511254
}
12521255

12531256
// Make sure the user is not using their username as their password.
@@ -1260,7 +1263,10 @@ class Edit_User extends \NDB_Form
12601263
|| (!empty($this->identifier)
12611264
&& $this->identifier === $values['Password_hash'])
12621265
) {
1263-
$errors['Password'] = self::PASSWORD_ERROR_IS_USER;
1266+
$errors['Password'] = dgettext(
1267+
"user_accounts",
1268+
"Your password cannot be your user name."
1269+
);
12641270
}
12651271

12661272
if (!is_null($this->identifier)) {
@@ -1286,7 +1292,10 @@ class Edit_User extends \NDB_Form
12861292
// Ensure that the password and confirm password fields match.
12871293
// TODO This validation should be done on the front-end instead.
12881294
if ($plaintext !== $values['__Confirm']) {
1289-
$errors['Password'] = self::PASSWORD_ERROR_NO_MATCH;
1295+
$errors['Password'] = dgettext(
1296+
"user_accounts",
1297+
"The passwords do not match."
1298+
);
12901299
}
12911300

12921301
// if password is user-defined, and user wants to change password
@@ -1302,7 +1311,10 @@ class Edit_User extends \NDB_Form
13021311
$isPasswordDifferent = \User::factory($this->identifier)
13031312
->isPasswordDifferent($decoded);
13041313
if (! $isPasswordDifferent) {
1305-
$errors['Password'] = self::PASSWORD_ERROR_NO_CHANGE;
1314+
$errors['Password'] = dgettext(
1315+
"user_accounts",
1316+
"New and old passwords are identical"
1317+
);
13061318
}
13071319
} catch (\InvalidArgumentException $e) {
13081320
$errors['Password'] = $e->getMessage();
@@ -1314,17 +1326,22 @@ class Edit_User extends \NDB_Form
13141326
&& $values['NA_Password'] == "on"
13151327
&& $values['SendEmail'] != "on"
13161328
) {
1317-
$errors['Email']
1318-
= 'When generating a new password, '
1319-
. 'please notify the user by checking Send email to user box';
1329+
$errors['Email'] = dgettext(
1330+
"user_accounts",
1331+
"When generating a new password, please notify the user by checking"
1332+
+ " 'Send email to user' box"
1333+
);
13201334
}
13211335

13221336
if (isset($values['NA_Password'])
13231337
&& $values['NA_Password'] == 'on'
13241338
&& $plaintext != ''
13251339
) {
1326-
$errors['Password'] = 'You must leave the password field empty '
1327-
. 'if you want the system to generate one for you';
1340+
$errors['Password'] = dgettext(
1341+
"user_accounts",
1342+
"You must leave the password field empty if you want the system to"
1343+
+ " generate one for you"
1344+
);
13281345
}
13291346

13301347
if (is_null($this->identifier)
@@ -1474,7 +1491,10 @@ class Edit_User extends \NDB_Form
14741491

14751492
// Email already exists in database
14761493
if ($result > 0) {
1477-
return self::EMAIL_NOT_UNIQUE;
1494+
return dgettext(
1495+
"user_accounts",
1496+
"This email address is already in use"
1497+
);
14781498
}
14791499

14801500
return null;

0 commit comments

Comments
 (0)