Fix Plural Strings

This commit is contained in:
safaalfulaij 2016-08-10 20:24:28 +03:00
parent 24201d4638
commit 291c32aa69
6 changed files with 39 additions and 19 deletions

View File

@ -96,7 +96,7 @@ const AdminUser = Discourse.User.extend({
deleteAllPosts() { deleteAllPosts() {
const user = this, 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 = [{ buttons = [{
"label": I18n.t("composer.cancel"), "label": I18n.t("composer.cancel"),
"class": "cancel-inline", "class": "cancel-inline",
@ -467,13 +467,13 @@ const AdminUser = Discourse.User.extend({
user.checkEmail().then(function() { user.checkEmail().then(function() {
const data = { const data = {
posts: user.get('post_count'), "POSTS": user.get('post_count'),
topics: user.get('topic_count'), "TOPICS": user.get('topic_count'),
email: user.get('email') || I18n.t("flagging.hidden_email_address"), email: user.get('email') || I18n.t("flagging.hidden_email_address"),
ip_address: user.get('ip_address') || I18n.t("flagging.ip_address_missing") 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 = [{ buttons = [{
"label": I18n.t("composer.cancel"), "label": I18n.t("composer.cancel"),
"class": "cancel-inline", "class": "cancel-inline",

View File

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

View File

@ -36,12 +36,12 @@ export default Ember.Component.extend({
const len = messageLength || 0; const len = messageLength || 0;
const minLen = Discourse.SiteSettings.min_private_message_post_length; const minLen = Discourse.SiteSettings.min_private_message_post_length;
if (len === 0) { 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) { } 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 { } else {
return I18n.t("flagging.custom_message.left", { 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() { willCloseI18n: function() {
if (this.get('model.details.auto_close_based_on_last_post')) { 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') }.property('model.details.auto_close_based_on_last_post', 'model.auto_close_time')

View File

@ -31,7 +31,7 @@
{{/if}} {{/if}}
{{#if showFilter}} {{#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}}
{{#if hasUserFilters}} {{#if hasUserFilters}}

View File

@ -1028,7 +1028,9 @@ en:
similar_topics: "Your topic is similar to..." similar_topics: "Your topic is similar to..."
drafts_offline: "drafts offline" 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?" 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: error:
@ -1263,7 +1265,9 @@ en:
unsubscribe: unsubscribe:
stop_notifications: "You will now receive less notifications for <strong>{{title}}</strong>" stop_notifications: "You will now receive less notifications for <strong>{{title}}</strong>"
change_notification_state: "Your current notification state is " change_notification_state: "Your current notification state is "
filter_to: "{{post_count}} posts in topic" filter_to:
one: "1 posts in topic"
other: "{{count}} posts in topic"
create: 'New Topic' create: 'New Topic'
create_long: 'Create a new Topic' create_long: 'Create a new Topic'
private_message: 'Start a message' private_message: 'Start a message'
@ -1341,7 +1345,9 @@ en:
auto_close_title: 'Auto-Close Settings' auto_close_title: 'Auto-Close Settings'
auto_close_save: "Save" auto_close_save: "Save"
auto_close_remove: "Don't Auto-Close This Topic" 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: timeline:
back: "Back" back: "Back"
@ -1864,7 +1870,9 @@ en:
notify_action: 'Message' notify_action: 'Message'
official_warning: 'Official Warning' official_warning: 'Official Warning'
delete_spammer: "Delete Spammer" 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 /spec/components/js_local_helper_spec.rb for samples
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" yes_delete_spammer: "Yes, Delete Spammer"
ip_address_missing: "(N/A)" ip_address_missing: "(N/A)"
hidden_email_address: "(hidden)" hidden_email_address: "(hidden)"
@ -1879,9 +1887,15 @@ en:
custom_placeholder_notify_user: "Be specific, be constructive, and always be kind." 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_placeholder_notify_moderators: "Let us know specifically what you are concerned about, and provide relevant links and examples where possible."
custom_message: custom_message:
at_least: "enter at least {{n}} characters" at_least:
more: "{{n}} to go..." one: "enter at least 1 character"
left: "{{n}} remaining" other: "enter at least {{count}} characters"
more:
one: "1 to go..."
other: "{{count}} to go..."
left:
one: "1 remaining"
other: "{{count}} remaining"
flagging_topic: flagging_topic:
title: "Thanks for helping to keep our community civil!" title: "Thanks for helping to keep our community civil!"
@ -1928,6 +1942,8 @@ en:
posts: "Posts" posts: "Posts"
posts_lowercase: "posts" posts_lowercase: "posts"
posts_long: "there are {{number}} posts in this topic" posts_long: "there are {{number}} posts in this topic"
# keys ending with _MF use message format, see /spec/components/js_local_helper_spec.rb for samples
posts_likes_MF: | posts_likes_MF: |
This topic has {count, plural, one {1 reply} other {# replies}} {ratio, select, This topic has {count, plural, one {1 reply} other {# replies}} {ratio, select,
low {with a high like to post ratio} low {with a high like to post ratio}
@ -2798,7 +2814,9 @@ en:
suspend_reason: "Reason" suspend_reason: "Reason"
suspended_by: "Suspended by" suspended_by: "Suspended by"
delete_all_posts: "Delete all posts" 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 /spec/components/js_local_helper_spec.rb for samples
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" suspend: "Suspend"
unsuspend: "Unsuspend" unsuspend: "Unsuspend"
suspended: "Suspended?" suspended: "Suspended?"
@ -2894,7 +2912,9 @@ en:
unlock_trust_level: "Unlock Trust Level" unlock_trust_level: "Unlock Trust Level"
tl3_requirements: tl3_requirements:
title: "Requirements for Trust Level 3" 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" value_heading: "Value"
requirement_heading: "Requirement" requirement_heading: "Requirement"
visits: "Visits" visits: "Visits"