From c4aa8d8401420f8f36a622dc279587ee07466925 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Sep 2011 23:29:52 +0200 Subject: [PATCH] [ticket/10345] Fix some last use cases of sprintf() to use $user->lang() PHPBB3-10345 --- phpBB/includes/acp/acp_users.php | 4 ++-- phpBB/includes/ucp/ucp_profile.php | 4 ++-- phpBB/includes/ucp/ucp_register.php | 4 ++-- phpBB/language/en/ucp.php | 20 ++++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 3ae1278396..a41fd3d17a 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1010,8 +1010,8 @@ class acp_users $db->sql_freeresult($result); $template->assign_vars(array( - 'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_NAME_CHARS_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])), + 'L_CHANGE_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])), 'L_POSTS_IN_QUEUE' => $user->lang('NUM_POSTS_IN_QUEUE', $user_row['posts_in_queue']), 'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false, diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 4822d7a421..c2082c99f6 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -248,8 +248,8 @@ class ucp_profile 'NEW_PASSWORD' => $data['new_password'], 'CUR_PASSWORD' => '', - 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_USERNAME_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])), + 'L_CHANGE_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])), 'S_FORCE_PASSWORD' => ($auth->acl_get('u_chgpasswd') && $config['chg_passforce'] && $user->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) ? true : false, 'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false, diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 20a4626ffa..fe09d0a9fe 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -475,8 +475,8 @@ class ucp_register 'EMAIL_CONFIRM' => $data['email_confirm'], 'L_REG_COND' => $l_reg_cond, - 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_USERNAME_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])), + 'L_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])), 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_TZ_OPTIONS' => tz_select($data['tz']), diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 0aa97ee81e..e4aa41cbfd 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -352,10 +352,10 @@ $lang = array_merge($lang, array( 'NO_WATCHED_SELECTED' => 'You have not selected any subscribed topics or forums.', 'NO_WATCHED_TOPICS' => 'You are not subscribed to any topics.', - 'PASS_TYPE_ALPHA_EXPLAIN' => 'Password must be between %1$d and %2$d characters long, must contain letters in mixed case and must contain numbers.', - 'PASS_TYPE_ANY_EXPLAIN' => 'Must be between %1$d and %2$d characters.', - 'PASS_TYPE_CASE_EXPLAIN' => 'Password must be between %1$d and %2$d characters long and must contain letters in mixed case.', - 'PASS_TYPE_SYMBOL_EXPLAIN' => 'Password must be between %1$d and %2$d characters long, must contain letters in mixed case, must contain numbers and must contain symbols.', + 'PASS_TYPE_ALPHA_EXPLAIN' => 'Password must be between %1$s and %2$s long, must contain letters in mixed case and must contain numbers.', + 'PASS_TYPE_ANY_EXPLAIN' => 'Must be between %1$s and %2$s.', + 'PASS_TYPE_CASE_EXPLAIN' => 'Password must be between %1$s and %2$s long and must contain letters in mixed case.', + 'PASS_TYPE_SYMBOL_EXPLAIN' => 'Password must be between %1$s and %2$s long, must contain letters in mixed case, must contain numbers and must contain symbols.', 'PASSWORD' => 'Password', 'PASSWORD_ACTIVATED' => 'Your new password has been activated.', 'PASSWORD_UPDATED' => 'A new password was sent to your registered e-mail address.', @@ -493,12 +493,12 @@ $lang = array_merge($lang, array( 'UPLOAD_AVATAR_FILE' => 'Upload from your machine', 'UPLOAD_AVATAR_URL' => 'Upload from a URL', 'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image. The image will be copied to this site.', - 'USERNAME_ALPHA_ONLY_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only alphanumeric characters.', - 'USERNAME_ALPHA_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use alphanumeric, space or -+_[] characters.', - 'USERNAME_ASCII_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only ASCII characters, so no special symbols.', - 'USERNAME_LETTER_NUM_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only letter or number characters.', - 'USERNAME_LETTER_NUM_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use letter, number, space or -+_[] characters.', - 'USERNAME_CHARS_ANY_EXPLAIN' => 'Length must be between %1$d and %2$d characters.', + 'USERNAME_ALPHA_ONLY_EXPLAIN' => 'Username must be between %1$s and %2$s long and use only alphanumeric characters.', + 'USERNAME_ALPHA_SPACERS_EXPLAIN'=> 'Username must be between %1$s and %2$s long and use alphanumeric, space or -+_[] characters.', + 'USERNAME_ASCII_EXPLAIN' => 'Username must be between %1$s and %2$s long and use only ASCII characters, so no special symbols.', + 'USERNAME_LETTER_NUM_EXPLAIN' => 'Username must be between %1$s and %2$s long and use only letter or number characters.', + 'USERNAME_LETTER_NUM_SPACERS_EXPLAIN'=> 'Username must be between %1$s and %2$s long and use letter, number, space or -+_[] characters.', + 'USERNAME_CHARS_ANY_EXPLAIN' => 'Length must be between %1$s and %2$s.', 'USERNAME_TAKEN_USERNAME' => 'The username you entered is already in use, please select an alternative.', 'USERNAME_DISALLOWED_USERNAME' => 'The username you entered has been disallowed or contains a disallowed word. Please choose a different name.', 'USER_NOT_FOUND_OR_INACTIVE' => 'The usernames you specified could either not be found or are not activated users.',