diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-04-08 22:45:19 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-04-08 22:45:19 +0200 |
commit | 1a09d64a77251fefbf742850744ebc9ee4460cbd (patch) | |
tree | d7c7157e4b9d75bb401ebef6b7e488fa05ae027c | |
parent | 73ac3d0fcd3aebade34efdbca6f48520b75729d6 (diff) | |
parent | a4f42676ea1741262db9380bab63c946c011a7ef (diff) | |
download | nextcloud-server-1a09d64a77251fefbf742850744ebc9ee4460cbd.tar.gz nextcloud-server-1a09d64a77251fefbf742850744ebc9ee4460cbd.zip |
Merge pull request #8117 from owncloud/fix-hard-coded-uman-str
Make hardcoded exception messages translatable
-rw-r--r-- | lib/private/user/manager.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/private/user/manager.php b/lib/private/user/manager.php index 8583a451f2d..a2ad9d17702 100644 --- a/lib/private/user/manager.php +++ b/lib/private/user/manager.php @@ -239,24 +239,25 @@ class Manager extends PublicEmitter { * @return bool | \OC\User\User the created user of false */ public function createUser($uid, $password) { + $l = \OC_L10N::get('lib'); // Check the name for bad characters // Allowed are: "a-z", "A-Z", "0-9" and "_.@-" if (preg_match('/[^a-zA-Z0-9 _\.@\-]/', $uid)) { - throw new \Exception('Only the following characters are allowed in a username:' - . ' "a-z", "A-Z", "0-9", and "_.@-"'); + throw new \Exception($l->t('Only the following characters are allowed in a username:' + . ' "a-z", "A-Z", "0-9", and "_.@-"')); } // No empty username if (trim($uid) == '') { - throw new \Exception('A valid username must be provided'); + throw new \Exception($l->t('A valid username must be provided')); } // No empty password if (trim($password) == '') { - throw new \Exception('A valid password must be provided'); + throw new \Exception($l->t('A valid password must be provided')); } // Check if user already exists if ($this->userExists($uid)) { - throw new \Exception('The username is already being used'); + throw new \Exception($l->t('The username is already being used')); } $this->emit('\OC\User', 'preCreateUser', array($uid, $password)); |