[ticket/12226] Split language strings to correctly allow multiple plural rules

PHPBB3-12226
This commit is contained in:
Joas Schilling 2014-02-24 09:46:31 +01:00
parent 4b7932e8b3
commit 87dfd76100
4 changed files with 14 additions and 9 deletions

View file

@ -1561,7 +1561,7 @@ function get_folder_status($folder_id, $folder)
'percent' => ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? round(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0,
);
$return['message'] = $user->lang('FOLDER_STATUS_MSG', (int) $return['max'], $return['cur'], $return['percent']);
$return['message'] = $user->lang('FOLDER_STATUS_MSG', $user->lang('MESSAGES_COUNT', (int) $return['max']), $return['cur'], $return['percent']);
return $return;
}

View file

@ -230,7 +230,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
// Something went wrong, only partially moved?
if ($num_moved != $folder_row['pm_count'])
{
trigger_error($user->lang('MOVE_PM_ERROR', (int) $folder_row['pm_count'], $num_moved));
trigger_error($user->lang('MOVE_PM_ERROR', $user->lang('MESSAGES_COUNT', (int) $folder_row['pm_count']), $num_moved));
}
break;
@ -421,7 +421,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$folder[PRIVMSGS_INBOX] = array(
'folder_name' => $user->lang['PM_INBOX'],
'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', (int) $user->data['message_limit'], $num_messages),
'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', $user->lang('MESSAGES_COUNT', (int) $user->data['message_limit']), $num_messages),
);
$sql = 'SELECT folder_id, folder_name, pm_count
@ -435,7 +435,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$num_user_folder++;
$folder[$row['folder_id']] = array(
'folder_name' => $row['folder_name'],
'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', (int) $user->data['message_limit'], $row['pm_count']),
'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', $user->lang('MESSAGES_COUNT', (int) $user->data['message_limit']), (int) $row['pm_count']),
);
}
$db->sql_freeresult($result);

View file

@ -394,6 +394,10 @@ $lang = array_merge($lang, array(
'MERGE_TOPIC' => 'Merge topic',
'MESSAGE' => 'Message',
'MESSAGES' => 'Messages',
'MESSAGES_COUNT' => array(
1 => '%d message',
2 => '%d messages',
),
'MESSAGE_BODY' => 'Message body',
'MINUTES' => 'Minutes',
'MODERATE' => 'Moderate',

View file

@ -216,8 +216,8 @@ $lang = array_merge($lang, array(
'FOES_UPDATED' => 'Your foes list has been updated successfully.',
'FOLDER_ADDED' => 'Folder successfully added.',
'FOLDER_MESSAGE_STATUS' => array(
1 => '%2$d from %1$d message stored',
2 => '%2$d from %1$d messages stored',
1 => '%2$d from %1$s stored',
2 => '%2$d from %1$s stored',
),
'FOLDER_NAME_EMPTY' => 'You must enter a name for this folder.',
'FOLDER_NAME_EXIST' => 'Folder <strong>%s</strong> already exists.',
@ -225,8 +225,8 @@ $lang = array_merge($lang, array(
'FOLDER_RENAMED' => 'Folder successfully renamed.',
'FOLDER_REMOVED' => 'Folder successfully removed.',
'FOLDER_STATUS_MSG' => array(
1 => 'Folder is %3$d%% full (%2$d from %1$d message stored)',
2 => 'Folder is %3$d%% full (%2$d from %1$d messages stored)',
1 => 'Folder is %3$d%% full (%2$d from %1$s stored)',
2 => 'Folder is %3$d%% full (%2$d from %1$s stored)',
),
'FORWARD_PM' => 'Forward PM',
'FORCE_PASSWORD_EXPLAIN' => 'Before you may continue browsing the board you are required to change your password.',
@ -297,7 +297,8 @@ $lang = array_merge($lang, array(
'MOVE_DOWN' => 'Move down',
'MOVE_MARKED_TO_FOLDER' => 'Move marked to %s',
'MOVE_PM_ERROR' => array(
2 => 'An error occurred while moving the messages to the new folder, only %2d from %1d messages were moved.',
1 => 'An error occurred while moving the messages to the new folder, only %2$d from %1$s was moved.',
2 => 'An error occurred while moving the messages to the new folder, only %2$d from %1$s were moved.',
),
'MOVE_TO_FOLDER' => 'Move to folder',
'MOVE_UP' => 'Move up',