Skip to content

Commit

Permalink
Fix i18n issues reported on Crowdin (discourse#10925)
Browse files Browse the repository at this point in the history
* Pluralize `discourse_narrative_bot.dice.not_enough_dice`
  The number of dice requires a pluralized string.
  Fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/278/en-ar#51346

* Always use "two-factor" instead of "second factor" or "two factor"
  Using different terms for the same thing is quite confusing.
  Fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-nl#40096

* Remove whitespace before ellipsis for consistency
  Fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-nl#53978

* Remove unused strings from locale file

* Correct grammar in `site_settings.review_media_unless_trust_level`
  Fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/248/en-nl#54018

* Correct grammar in `reviewables.reasons.contains_media`
  Fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/248/en-nl#54020

* Correct grammar in user notifications
  It also adds a link to the /about page in order to give the user a clue who the site admins are.
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/248/en-nl#54084

* Use "log in" instead of "login" when it's a verb
  This fixes multiple issues:
  * https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-nl#40940
  * https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/248/en-nl#47858
  * https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/248/en-nl#49458

* Replace "Github" with "GitHub"

* Remove "discourse.org" from title of 503 error page

* Replace weirdly formatted multi line string

* Pluralize `js.composer.group_mentioned_limit`
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#41158

* Remove unused string and pluralize `js.topic.feature_topic.confirm_pin_globally`
  This kinda fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#42114 as `js.topic.feature_topic.confirm_pin` wasn't used anymore.

* Pluralize `js.user.second_factor_backup.remaining_codes`
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#40054

* Pluralize `js.composer.error.tags_missing`
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#41184

* Pluralize `js.post.errors.too_many_dragged_and_dropped_files`
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#42408

* Remove unused `js.posts_long` and `js.likes_long`
  This fixes the following issues in an unexpected way:
  * https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#42974
  * https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#42994

* Pluralize `js.bootstrap_mode_enabled`
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#38726

* Remove unused `long_form` from `post_action_types`
  This more or less fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/248/en-ar#47158

* Pluralize `js.presence.replying` and `js.presence.replying`
  This fixes the following issues:
  * https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/282/en-ar#51588
  * https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/282/en-ar#51590

* Pluralize `js.user.second_factor_backup.manage`
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#40044

* Stop using concatenated strings for "Recently Used Devices"
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#40308

* Pluralize `js.category_row.topic_count`
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#41056

* Pluralize `js.select_kit.invalid_selection_length`
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#41072

* Pluralize `js.notifications.membership_request_consolidated`
  This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/246/en-ar#41416
  • Loading branch information
gschlager authored Oct 16, 2020
1 parent d5ef618 commit 7adf71a
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,9 @@ export default Component.extend({
// Limit the number of simultaneous uploads
if (max > 0 && data.files.length > max) {
bootbox.alert(
I18n.t("post.errors.too_many_dragged_and_dropped_files", { max })
I18n.t("post.errors.too_many_dragged_and_dropped_files", {
count: max,
})
);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default Component.extend({
notices.push(
Notice.create({
text: I18n.t("bootstrap_mode_enabled", {
min_users: this.siteSettings.bootstrap_mode_min_users,
count: this.siteSettings.bootstrap_mode_min_users,
}),
id: "alert-bootstrap-mode",
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ export default Controller.extend({
if (group.max_mentions < group.user_count) {
body = I18n.t("composer.group_mentioned_limit", {
group: `@${group.name}`,
max: group.max_mentions,
count: group.max_mentions,
group_link: groupLink,
});
} else if (group.user_count > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,20 @@ export default Controller.extend(ModalFunctionality, {
this.send("closeModal");
},

_confirmBeforePinning(count, name, action) {
_confirmBeforePinningGlobally() {
const count = this.pinnedGloballyCount;
if (count < 4) {
this._forwardAction(action);
this._forwardAction("pinGlobally");
} else {
this.send("hideModal");
bootbox.confirm(
I18n.t("topic.feature_topic.confirm_" + name, { count }),
I18n.t("topic.feature_topic.confirm_pin_globally", { count }),
I18n.t("no_value"),
I18n.t("yes_value"),
(confirmed) =>
confirmed ? this._forwardAction(action) : this.send("reopenModal")
confirmed
? this._forwardAction("pinGlobally")
: this.send("reopenModal")
);
}
},
Expand All @@ -161,11 +164,7 @@ export default Controller.extend(ModalFunctionality, {
if (this.pinGloballyDisabled) {
this.set("pinGloballyTipShownAt", Date.now());
} else {
this._confirmBeforePinning(
this.pinnedGloballyCount,
"pin_globally",
"pinGlobally"
);
this._confirmBeforePinningGlobally();
}
},

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/mixins/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default Mixin.create({
if (maxFiles > 0 && data.files.length > maxFiles) {
bootbox.alert(
I18n.t("post.errors.too_many_dragged_and_dropped_files", {
max: maxFiles,
count: maxFiles,
})
);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,13 @@
showToken=(action "showToken")}}
{{/unless}}
<div class="auth-token-first">
<span class="auth-token-device">{{token.device}}</span> &ndash; <span title="{{i18n "user.auth_tokens.ip"}}: {{token.client_ip}}">{{token.location}}</span>
{{html-safe (i18n "user.auth_tokens.device_location" device=token.device ip=token.client_ip location=token.location)}}
</div>
<div class="auth-token-second">
{{token.browser}} |
{{#if token.is_active}}
<span class="active">{{i18n "user.auth_tokens.active"}}</span>
{{html-safe (i18n "user.auth_tokens.browser_active" browser=token.browser)}}
{{else}}
{{format-date token.seen_at}}
{{html-safe (i18n "user.auth_tokens.browser_last_seen" browser=token.browser date=(format-date token.seen_at))}}
{{/if}}
</div>
</div>
Expand Down
11 changes: 0 additions & 11 deletions app/assets/javascripts/discourse/tests/fixtures/site-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ export default {
name: "Bookmark",
description: "Bookmark this post",
short_description: "Bookmark this post",
long_form: "bookmarked this post",
is_flag: false,
icon: null,
id: 1,
Expand All @@ -431,7 +430,6 @@ export default {
name: "Like",
description: "Like this post",
short_description: "Like this post",
long_form: "liked this",
is_flag: false,
icon: "heart",
id: 2,
Expand All @@ -443,7 +441,6 @@ export default {
description:
"This post is radically off-topic in the current topic, and should probably be moved. If this is a topic, perhaps it does not belong here.",
short_description: "Not relevant to the discussion",
long_form: "flagged this as off-topic",
is_flag: true,
icon: null,
id: 3,
Expand All @@ -456,7 +453,6 @@ export default {
'This post contains content that a reasonable person would consider offensive, abusive, or a violation of <a href="/guidelines">our community guidelines</a>.',
short_description:
'A violation of <a href="/guidelines">our community guidelines</a>',
long_form: "flagged this as inappropriate",
is_flag: true,
icon: null,
id: 4,
Expand All @@ -467,7 +463,6 @@ export default {
name: "Vote",
description: "Vote for this post",
short_description: "Vote for this post",
long_form: "voted for this post",
is_flag: false,
icon: null,
id: 5,
Expand All @@ -479,7 +474,6 @@ export default {
description:
"This post is an advertisement. It is not useful or relevant to the current topic, but promotional in nature.",
short_description: "This is an advertisement",
long_form: "flagged this as spam",
is_flag: true,
icon: null,
id: 8,
Expand All @@ -492,7 +486,6 @@ export default {
"This post contains something I want to talk to this person directly and privately about. Does not cast a flag.",
short_description:
"I want to talk to this person directly and privately about their post.",
long_form: "notified user",
is_flag: true,
icon: null,
id: 6,
Expand All @@ -504,7 +497,6 @@ export default {
description:
'This post requires general moderator attention based on the <a href="/guidelines">guidelines</a>, <a href="/tos">TOS</a>, or for another reason not listed above.',
short_description: "Requires staff attention for another reason",
long_form: "notified moderators",
is_flag: true,
icon: null,
id: 7,
Expand All @@ -517,7 +509,6 @@ export default {
name: "Inappropriate",
description:
'This topic contains content that a reasonable person would consider offensive, abusive, or a violation of <a href="/guidelines">our community guidelines</a>.',
long_form: "flagged this as inappropriate",
is_flag: true,
icon: null,
id: 4,
Expand All @@ -528,7 +519,6 @@ export default {
name: "Spam",
description:
"This topic is an advertisement. It is not useful or relevant to this site, but promotional in nature.",
long_form: "flagged this as spam",
is_flag: true,
icon: null,
id: 8,
Expand All @@ -539,7 +529,6 @@ export default {
name: "Notify moderators",
description:
'This topic requires general moderator attention based on the <a href="/guidelines">guidelines</a>, <a href="/tos">TOS</a>, or for another reason not listed above.',
long_form: "notified moderators",
is_flag: true,
icon: null,
id: 7,
Expand Down
5 changes: 0 additions & 5 deletions app/serializers/post_action_type_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class PostActionTypeSerializer < ApplicationSerializer
:name,
:description,
:short_description,
:long_form,
:is_flag,
:is_custom_flag
)
Expand All @@ -27,10 +26,6 @@ def name
i18n('title')
end

def long_form
i18n('long_form')
end

def description
i18n('description', tos_url: tos_path, base_path: Discourse.base_path)
end
Expand Down
Loading

0 comments on commit 7adf71a

Please sign in to comment.