REFACTOR: Update Message Format string to simplify translation

This commit is contained in:
Gerhard Schlager 2022-12-10 15:31:37 +01:00 committed by Gerhard Schlager
parent 17b7ab0d7b
commit 584abbda54
2 changed files with 80 additions and 37 deletions

View File

@ -50,7 +50,7 @@ export default Component.extend({
if (suggestedGroupName) {
return I18n.messageFormat("user.messages.read_more_group_pm_MF", {
BOTH: hasBoth,
HAS_UNREAD_AND_NEW: hasBoth,
UNREAD: unreadCount,
NEW: newCount,
username,
@ -60,7 +60,7 @@ export default Component.extend({
});
} else {
return I18n.messageFormat("user.messages.read_more_personal_pm_MF", {
BOTH: hasBoth,
HAS_UNREAD_AND_NEW: hasBoth,
UNREAD: unreadCount,
NEW: newCount,
username,

View File

@ -1295,35 +1295,71 @@ en:
read_more_in_group: "Want to read more? Browse other messages in %{groupLink}."
read_more: "Want to read more? Browse other messages in <a href='%{basePath}/u/%{username}/messages'>personal messages</a>."
read_more_group_pm_MF: "There {
UNREAD, plural,
=0 {}
one {
is <a href='{basePath}/u/{username}/messages/group/{groupName}/unread'># unread</a>
} other {
are <a href='{basePath}/u/{username}/messages/group/{groupName}/unread'># unread</a>
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
#
# Both UNREAD and NEW are greater than 0 when HAS_UNREAD_AND_NEW is true
# Either UNREAD or NEW is greater than 0 when HAS_UNREAD_AND_NEW is false
read_more_group_pm_MF: |
{ HAS_UNREAD_AND_NEW, select,
true {
{ UNREAD, plural,
=0 {}
one { There is <a href='{basePath}/u/{username}/messages/group/{groupName}/unread'># unread</a> }
other { There are <a href='{basePath}/u/{username}/messages/group/{groupName}/unread'># unread</a> }
}
{ NEW, plural,
=0 {}
one { and <a href='{basePath}/u/{username}/messages/group/{groupName}/new'># new</a> message remaining, or browse other messages in {groupLink} }
other { and <a href='{basePath}/u/{username}/messages/group/{groupName}/new'># new</a> messages remaining, or browse other messages in {groupLink} }
}
}
false {
{ UNREAD, plural,
=0 {}
one { There is <a href='{basePath}/u/{username}/messages/group/{groupName}/unread'># unread</a> message remaining, or browse other messages in {groupLink} }
other { There are <a href='{basePath}/u/{username}/messages/group/{groupName}/unread'># unread</a> messages remaining, or browse other messages in {groupLink} }
}
{ NEW, plural,
=0 {}
one { There is <a href='{basePath}/u/{username}/messages/group/{groupName}/new'># new</a> message remaining, or browse other messages in {groupLink} }
other { There are <a href='{basePath}/u/{username}/messages/group/{groupName}/new'># new</a> messages remaining, or browse other messages in {groupLink} }
}
}
other {}
}
} {
NEW, plural,
=0 {}
one { {BOTH, select, true{and } false {is } other{}} <a href='{basePath}/u/{username}/messages/group/{groupName}/new'># new</a> message}
other { {BOTH, select, true{and } false {are } other{}} <a href='{basePath}/u/{username}/messages/group/{groupName}/new'># new</a> messages}
} remaining, or browse other messages in {groupLink}"
read_more_personal_pm_MF: "There {
UNREAD, plural,
=0 {}
one {
is <a href='{basePath}/u/{username}/messages/unread'># unread</a>
} other {
are <a href='{basePath}/u/{username}/messages/unread'># unread</a>
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
#
# Both UNREAD and NEW are greater than 0 when HAS_UNREAD_AND_NEW is true
# Either UNREAD or NEW is greater than 0 when HAS_UNREAD_AND_NEW is false
read_more_personal_pm_MF: |
{ HAS_UNREAD_AND_NEW, select,
true {
{ UNREAD, plural,
=0 {}
one { There is <a href='{basePath}/u/{username}/messages/unread'># unread</a> }
other { There are <a href='{basePath}/u/{username}/messages/unread'># unread</a> }
}
{ NEW, plural,
=0 {}
one { and <a href='{basePath}/u/{username}/messages/new'># new</a> message remaining, or browse other <a href='{basePath}/u/{username}/messages'>personal messages</a> }
other { and <a href='{basePath}/u/{username}/messages/new'># new</a> messages remaining, or browse other <a href='{basePath}/u/{username}/messages'>personal messages</a> }
}
}
false {
{ UNREAD, plural,
=0 {}
one { There is <a href='{basePath}/u/{username}/messages/unread'># unread</a> message remaining, or browse other <a href='{basePath}/u/{username}/messages'>personal messages</a> }
other { There are <a href='{basePath}/u/{username}/messages/unread'># unread</a> messages remaining, or browse other <a href='{basePath}/u/{username}/messages'>personal messages</a> }
}
{ NEW, plural,
=0 {}
one { There is <a href='{basePath}/u/{username}/messages/new'># new</a> message remaining, or browse other <a href='{basePath}/u/{username}/messages'>personal messages</a> }
other { There are <a href='{basePath}/u/{username}/messages/new'># new</a> messages remaining, or browse other <a href='{basePath}/u/{username}/messages'>personal messages</a> }
}
}
other {}
}
} {
NEW, plural,
=0 {}
one { {BOTH, select, true{and } false {is } other{}} <a href='{basePath}/u/{username}/messages/new'># new</a> message}
other { {BOTH, select, true{and } false {are } other{}} <a href='{basePath}/u/{username}/messages/new'># new</a> messages}
} remaining, or browse other <a href='{basePath}/u/{username}/messages'>personal messages</a>"
preferences_nav:
account: "Account"
@ -1893,30 +1929,36 @@ en:
logout_disabled: "Logout is disabled while the site is in read only mode."
staff_writes_only_mode:
enabled: "This site is in staff only mode. Please continue to browse, but replying, likes, and other actions are limited to staff members only."
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
too_few_topics_and_posts_notice_MF: >-
Let's <a href="https://blog.discourse.org/2014/08/building-a-discourse-community/" target="_blank" rel="noopener noreferrer">start the discussion!</a>
There {currentTopics, plural, one {is <strong>#</strong> topic} other {are <strong>#</strong> topics}} and
{currentPosts, plural, one {<strong>#</strong> post} other {<strong>#</strong> posts}}. Visitors need more to
read and reply to we recommend at least {requiredTopics, plural, one {<strong>#</strong> topic} other {<strong>#</strong> topics}}
and {requiredPosts, plural, one {<strong>#</strong> post} other {<strong>#</strong> posts}}. Only staff can see this message.
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
too_few_topics_notice_MF: >-
Let's <a href="https://blog.discourse.org/2014/08/building-a-discourse-community/" target="_blank" rel="noopener noreferrer">start the discussion!</a>
There {currentTopics, plural, one {is <strong>#</strong> topic} other {are <strong>#</strong> topics}}. Visitors need more to
read and reply to we recommend at least {requiredTopics, plural, one {<strong>#</strong> topic} other {<strong>#</strong> topics}}.
Only staff can see this message.
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
too_few_posts_notice_MF: >-
Let's <a href="https://blog.discourse.org/2014/08/building-a-discourse-community/" target="_blank" rel="noopener noreferrer">start the discussion!</a>
There {currentPosts, plural, one {is <strong>#</strong> post} other {are <strong>#</strong> posts}}. Visitors need more to
read and reply to we recommend at least {requiredPosts, plural, one {<strong>#</strong> post} other {<strong>#</strong> posts}}.
Only staff can see this message.
logs_error_rate_notice:
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
reached_hour_MF: "<b>{relativeAge}</b> <a href='{url}' target='_blank'>{rate, plural, one {# error/hour} other {# errors/hour}}</a> reached site setting limit of {limit, plural, one {# error/hour} other {# errors/hour}}."
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
reached_minute_MF: "<b>{relativeAge}</b> <a href='{url}' target='_blank'>{rate, plural, one {# error/minute} other {# errors/minute}}</a> reached site setting limit of {limit, plural, one {# error/minute} other {# errors/minute}}."
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
exceeded_hour_MF: "<b>{relativeAge}</b> <a href='{url}' target='_blank'>{rate, plural, one {# error/hour} other {# errors/hour}}</a> exceeded site setting limit of {limit, plural, one {# error/hour} other {# errors/hour}}."
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
exceeded_minute_MF: "<b>{relativeAge}</b> <a href='{url}' target='_blank'>{rate, plural, one {# error/minute} other {# errors/minute}}</a> exceeded site setting limit of {limit, plural, one {# error/minute} other {# errors/minute}}."
learn_more: "learn more..."
@ -1948,7 +1990,7 @@ en:
description:
one: "There is <b>%{count}</b> reply."
other: "There are <b>%{count}</b> replies."
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
description_time_MF: "There {replyCount, plural, one {is <b>#</b> reply} other {are <b>#</b> replies}} with an estimated read time of <b>{readingTime, plural, one {# minute} other {# minutes}}</b>."
enable: "Summarize This Topic"
disable: "Show All Posts"
@ -2825,7 +2867,7 @@ en:
read_more: "Want to read more? %{catLink} or %{latestLink}."
unread_indicator: "No member has read the last post of this topic yet."
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
read_more_MF: "There {
UNREAD, plural,
=0 {}
@ -2841,6 +2883,7 @@ en:
other { {BOTH, select, true{and } false {are } other{}} <a href='{basePath}/new'># new</a> topics}
} remaining, or {CATEGORY, select, true {browse other topics in {catLink}} false {{latestLink}} other {}}"
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
bumped_at_title_MF: "{FIRST_POST}: {CREATED_AT}\n{LAST_POST}: {BUMPED_AT}"
browse_all_categories: Browse all categories
@ -3657,7 +3700,7 @@ en:
delete_spammer: "Delete Spammer"
flag_for_review: "Queue For Review"
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
delete_confirm_MF: "You are about to delete {POSTS, plural, one {<b>#</b> post} other {<b>#</b> posts}} and {TOPICS, plural, one {<b>#</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)"
@ -3732,7 +3775,7 @@ en:
label: "Pending"
label_with_count: "Pending (%{count})"
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
posts_likes_MF: |
This topic has {count, plural, one {# reply} other {# replies}} {ratio, select,
low {with a high like to post ratio}
@ -5424,7 +5467,7 @@ en:
title: "Clear Penalty History"
description: "users with penalties cannot reach TL3"
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
# This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
delete_all_posts_confirm_MF: "You are about to delete {POSTS, plural, one {# post} other {# posts}} and {TOPICS, plural, one {# topic} other {# topics}}. Are you sure?"
silence: "Silence"
unsilence: "Unsilence"