diff --git a/app/assets/javascripts/admin/models/admin-user.js.es6 b/app/assets/javascripts/admin/models/admin-user.js.es6 index d804894770a..411dac89b8a 100644 --- a/app/assets/javascripts/admin/models/admin-user.js.es6 +++ b/app/assets/javascripts/admin/models/admin-user.js.es6 @@ -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", diff --git a/app/assets/javascripts/admin/templates/user-tl3-requirements.hbs b/app/assets/javascripts/admin/templates/user-tl3-requirements.hbs index a9b1cfdc8c7..e0536ddd087 100644 --- a/app/assets/javascripts/admin/templates/user-tl3-requirements.hbs +++ b/app/assets/javascripts/admin/templates/user-tl3-requirements.hbs @@ -10,7 +10,7 @@

{{model.username}} - {{i18n 'admin.user.tl3_requirements.title'}}


-

{{i18n 'admin.user.tl3_requirements.table_title' time_period=model.tl3Requirements.time_period}}

+

{{i18n 'admin.user.tl3_requirements.table_title' count=model.tl3Requirements.time_period}}

diff --git a/app/assets/javascripts/discourse/components/flag-action-type.js.es6 b/app/assets/javascripts/discourse/components/flag-action-type.js.es6 index 031831219c3..377f2129c97 100644 --- a/app/assets/javascripts/discourse/components/flag-action-type.js.es6 +++ b/app/assets/javascripts/discourse/components/flag-action-type.js.es6 @@ -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 }); } }, diff --git a/app/assets/javascripts/discourse/controllers/edit-topic-auto-close.js.es6 b/app/assets/javascripts/discourse/controllers/edit-topic-auto-close.js.es6 index f0f4301f345..bb857e8d035 100644 --- a/app/assets/javascripts/discourse/controllers/edit-topic-auto-close.js.es6 +++ b/app/assets/javascripts/discourse/controllers/edit-topic-auto-close.js.es6 @@ -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') diff --git a/app/assets/javascripts/discourse/templates/user-card.hbs b/app/assets/javascripts/discourse/templates/user-card.hbs index 68503261b3d..7fcaa7f2ef6 100644 --- a/app/assets/javascripts/discourse/templates/user-card.hbs +++ b/app/assets/javascripts/discourse/templates/user-card.hbs @@ -31,7 +31,7 @@ {{/if}} {{#if showFilter}} -
  • {{fa-icon "filter"}}{{i18n 'topic.filter_to' username=username post_count=topicPostCount}}
  • +
  • {{fa-icon "filter"}}{{i18n 'topic.filter_to' username=username count=topicPostCount}}
  • {{/if}} {{#if hasUserFilters}} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 1a3c2912c26..8a9b1b633a1 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -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 {{count}} people – are you sure?" + group_mentioned: + one: "By mentioning {{group}}, you are about to notify 1 person – are you sure?" + other: "By mentioning {{group}}, you are about to notify {{count}} people – are you sure?" duplicate_link: "It looks like your link to {{domain}} was already posted in the topic by @{{username}} in a reply {{ago}} – 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 {{title}}" 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 %{posts} posts and %{topics} topics from this user, remove their account, block signups from their IP address %{ip_address}, and add their email address %{email} 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 {1 post} other {# posts}} and {TOPICS, plural, one {1 topic} other {# topics}} from this user, remove their account, block signups from their IP address %{ip_address}, and add their email address %{email} 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"