diff options
author | kondou <kondou@ts.unde.re> | 2013-09-18 16:47:27 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-09-18 16:47:27 +0200 |
commit | 18a2c48ceb2206fbc871dc0c28e5fb233b4fc0fc (patch) | |
tree | 34de64e46977d52ea996251700e56f3c47d82bd1 /settings/changepassword/controller.php | |
parent | 18da2f9cf76815faeaa6ae162fa8af2d80aaeb3e (diff) | |
download | nextcloud-server-18a2c48ceb2206fbc871dc0c28e5fb233b4fc0fc.tar.gz nextcloud-server-18a2c48ceb2206fbc871dc0c28e5fb233b4fc0fc.zip |
Translate errormsgs in settings/changepassword/controller
Diffstat (limited to 'settings/changepassword/controller.php')
-rw-r--r-- | settings/changepassword/controller.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/settings/changepassword/controller.php b/settings/changepassword/controller.php index 53bd69a2cd0..1ecb644a96c 100644 --- a/settings/changepassword/controller.php +++ b/settings/changepassword/controller.php @@ -69,19 +69,27 @@ class Controller { } if ($recoveryEnabledForUser && $recoveryPassword === '') { - \OC_JSON::error(array('data' => array('message' => 'Please provide a admin recovery password, otherwise all user data will be lost'))); + $l = new \OC_L10n('settings'); + \OC_JSON::error(array('data' => array( + 'message' => $l->t('Please provide an admin recovery password, otherwise all user data will be lost') + ))); } elseif ($recoveryEnabledForUser && ! $validRecoveryPassword) { - \OC_JSON::error(array('data' => array('message' => 'Wrong admin recovery password. Please check the password and try again.'))); + $l = new \OC_L10n('settings'); + \OC_JSON::error(array('data' => array( + 'message' => $l->t('Wrong admin recovery password. Please check the password and try again.') + ))); } else { // now we know that everything is fine regarding the recovery password, let's try to change the password $result = \OC_User::setPassword($username, $password, $recoveryPassword); if (!$result && $recoveryPasswordSupported) { + $l = new \OC_L10n('settings'); \OC_JSON::error(array( "data" => array( - "message" => "Back-end doesn't support password change, but the users encryption key was successfully updated." + "message" => $l->t("Back-end doesn't support password change, but the users encryption key was successfully updated.") ) )); } elseif (!$result && !$recoveryPasswordSupported) { - \OC_JSON::error(array("data" => array( "message" => "Unable to change password" ))); + $l = new \OC_L10n('settings'); + \OC_JSON::error(array("data" => array( $l->t("message" => "Unable to change password" ) ))); } else { \OC_JSON::success(array("data" => array( "username" => $username ))); } @@ -91,7 +99,8 @@ class Controller { if (!is_null($password) && \OC_User::setPassword($username, $password)) { \OC_JSON::success(array('data' => array('username' => $username))); } else { - \OC_JSON::error(array('data' => array('message' => 'Unable to change password'))); + $l = new \OC_L10n('settings'); + \OC_JSON::error(array('data' => array('message' => $l->t('Unable to change password')))); } } } |