Merge pull request #4382 from SafaAlfulaij/fix_plural_strings

Fix Plural Strings That are Not Marked as Plural
This commit is contained in:
Guo Xiang Tan 2016-08-11 09:18:37 +08:00 committed by GitHub
commit 01d79d9129
6 changed files with 40 additions and 20 deletions

View File

@ -96,7 +96,7 @@ const AdminUser = Discourse.User.extend({
deleteAllPosts() {
const user = this,
message = I18n.t('admin.user.delete_all_posts_confirm', { posts: user.get('post_count'), topics: user.get('topic_count') }),
message = I18n.messageFormat('admin.user.delete_all_posts_confirm_MF', { "POSTS": user.get('post_count'), "TOPICS": user.get('topic_count') }),
buttons = [{
"label": I18n.t("composer.cancel"),
"class": "cancel-inline",
@ -467,13 +467,13 @@ const AdminUser = Discourse.User.extend({
user.checkEmail().then(function() {
const data = {
posts: user.get('post_count'),
topics: user.get('topic_count'),
"POSTS": user.get('post_count'),
"TOPICS": user.get('topic_count'),
email: user.get('email') || I18n.t("flagging.hidden_email_address"),
ip_address: user.get('ip_address') || I18n.t("flagging.ip_address_missing")
};
const message = I18n.t('flagging.delete_confirm', data),
const message = I18n.messageFormat('flagging.delete_confirm_MF', data),
buttons = [{
"label": I18n.t("composer.cancel"),
"class": "cancel-inline",

View File

@ -10,7 +10,7 @@
<div class="admin-container tl3-requirements">
<h2>{{model.username}} - {{i18n 'admin.user.tl3_requirements.title'}}</h2>
<br/>
<p>{{i18n 'admin.user.tl3_requirements.table_title' time_period=model.tl3Requirements.time_period}}</p>
<p>{{i18n 'admin.user.tl3_requirements.table_title' count=model.tl3Requirements.time_period}}</p>
<table class="table" style="width: auto;">
<thead>

View File

@ -36,12 +36,12 @@ export default Ember.Component.extend({
const len = messageLength || 0;
const minLen = Discourse.SiteSettings.min_private_message_post_length;
if (len === 0) {
return I18n.t("flagging.custom_message.at_least", { n: minLen });
return I18n.t("flagging.custom_message.at_least", { count: minLen });
} else if (len < minLen) {
return I18n.t("flagging.custom_message.more", { n: minLen - len });
return I18n.t("flagging.custom_message.more", { count: minLen - len });
} else {
return I18n.t("flagging.custom_message.left", {
n: MAX_MESSAGE_LENGTH - len
count: MAX_MESSAGE_LENGTH - len
});
}
},

View File

@ -69,7 +69,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
willCloseI18n: function() {
if (this.get('model.details.auto_close_based_on_last_post')) {
return I18n.t('topic.auto_close_immediate', {hours: this.get('model.auto_close_time')});
return I18n.t('topic.auto_close_immediate', {count: this.get('model.auto_close_time')});
}
}.property('model.details.auto_close_based_on_last_post', 'model.auto_close_time')

View File

@ -31,7 +31,7 @@
{{/if}}
{{#if showFilter}}
<li><a class='btn' href {{action "togglePosts" user}}>{{fa-icon "filter"}}{{i18n 'topic.filter_to' username=username post_count=topicPostCount}}</a></li>
<li><a class='btn' href {{action "togglePosts" user}}>{{fa-icon "filter"}}{{i18n 'topic.filter_to' username=username count=topicPostCount}}</a></li>
{{/if}}
{{#if hasUserFilters}}

View File

@ -1028,7 +1028,9 @@ en:
similar_topics: "Your topic is similar to..."
drafts_offline: "drafts offline"
group_mentioned: "By mentioning {{group}}, you are about to notify <a href='{{group_link}}'>{{count}} people</a> are you sure?"
group_mentioned:
one: "By mentioning {{group}}, you are about to notify <a href='{{group_link}}'>1 person</a> are you sure?"
other: "By mentioning {{group}}, you are about to notify <a href='{{group_link}}'>{{count}} people</a> are you sure?"
duplicate_link: "It looks like your link to <b>{{domain}}</b> was already posted in the topic by <b>@{{username}}</b> in <a href='{{post_url}}'>a reply {{ago}}</a> are you sure you want to post it again?"
error:
@ -1263,7 +1265,9 @@ en:
unsubscribe:
stop_notifications: "You will now receive less notifications for <strong>{{title}}</strong>"
change_notification_state: "Your current notification state is "
filter_to: "{{post_count}} posts in topic"
filter_to:
one: "1 post in topic"
other: "{{count}} posts in topic"
create: 'New Topic'
create_long: 'Create a new Topic'
private_message: 'Start a message'
@ -1312,7 +1316,7 @@ en:
read_more_in_category: "Want to read more? Browse other topics in {{catLink}} or {{latestLink}}."
read_more: "Want to read more? {{catLink}} or {{latestLink}}."
# keys ending with _MF use message format, see /spec/components/js_local_helper_spec.rb for samples
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
read_more_MF: "There {
UNREAD, plural,
=0 {}
@ -1341,7 +1345,9 @@ en:
auto_close_title: 'Auto-Close Settings'
auto_close_save: "Save"
auto_close_remove: "Don't Auto-Close This Topic"
auto_close_immediate: "The last post in the topic is already %{hours} hours old, so the topic will be closed immediately."
auto_close_immediate:
one: "The last post in the topic is already 1 hour old, so the topic will be closed immediately."
other: "The last post in the topic is already %{count} hours old, so the topic will be closed immediately."
timeline:
back: "Back"
@ -1864,7 +1870,9 @@ en:
notify_action: 'Message'
official_warning: 'Official Warning'
delete_spammer: "Delete Spammer"
delete_confirm: "You are about to delete <b>%{posts}</b> posts and <b>%{topics}</b> topics from this user, remove their account, block signups from their IP address <b>%{ip_address}</b>, and add their email address <b>%{email}</b> to a permanent block list. Are you sure this user is really a spammer?"
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
delete_confirm_MF: "You are about to delete {POSTS, plural, one {<b>1</b> post} other {<b>#</b> posts}} and {TOPICS, plural, one {<b>1</b> topic} other {<b>#</b> topics}} from this user, remove their account, block signups from their IP address <b>%{ip_address}</b>, and add their email address <b>%{email}</b> to a permanent block list. Are you sure this user is really a spammer?"
yes_delete_spammer: "Yes, Delete Spammer"
ip_address_missing: "(N/A)"
hidden_email_address: "(hidden)"
@ -1879,9 +1887,15 @@ en:
custom_placeholder_notify_user: "Be specific, be constructive, and always be kind."
custom_placeholder_notify_moderators: "Let us know specifically what you are concerned about, and provide relevant links and examples where possible."
custom_message:
at_least: "enter at least {{n}} characters"
more: "{{n}} to go..."
left: "{{n}} remaining"
at_least:
one: "enter at least 1 character"
other: "enter at least {{count}} characters"
more:
one: "1 to go..."
other: "{{count}} to go..."
left:
one: "1 remaining"
other: "{{count}} remaining"
flagging_topic:
title: "Thanks for helping to keep our community civil!"
@ -1928,6 +1942,8 @@ en:
posts: "Posts"
posts_lowercase: "posts"
posts_long: "there are {{number}} posts in this topic"
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
posts_likes_MF: |
This topic has {count, plural, one {1 reply} other {# replies}} {ratio, select,
low {with a high like to post ratio}
@ -2798,7 +2814,9 @@ en:
suspend_reason: "Reason"
suspended_by: "Suspended by"
delete_all_posts: "Delete all posts"
delete_all_posts_confirm: "You are about to delete %{posts} posts and %{topics} topics. Are you sure?"
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
delete_all_posts_confirm_MF: "You are about to delete {POSTS, plural, one {1 post} other {# posts}} and {TOPICS, plural, one {1 topic} other {# topics}}. Are you sure?"
suspend: "Suspend"
unsuspend: "Unsuspend"
suspended: "Suspended?"
@ -2894,7 +2912,9 @@ en:
unlock_trust_level: "Unlock Trust Level"
tl3_requirements:
title: "Requirements for Trust Level 3"
table_title: "In the last %{time_period} days:"
table_title:
one: "In the last day:"
other: "In the last %{count} days:"
value_heading: "Value"
requirement_heading: "Requirement"
visits: "Visits"