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

View File

@ -1295,35 +1295,71 @@ en:
read_more_in_group: "Want to read more? Browse other messages in %{groupLink}." 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: "Want to read more? Browse other messages in <a href='%{basePath}/u/%{username}/messages'>personal messages</a>."
read_more_group_pm_MF: "There { # This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
UNREAD, plural, #
=0 {} # Both UNREAD and NEW are greater than 0 when HAS_UNREAD_AND_NEW is true
one { # Either UNREAD or NEW is greater than 0 when HAS_UNREAD_AND_NEW is false
is <a href='{basePath}/u/{username}/messages/group/{groupName}/unread'># unread</a> read_more_group_pm_MF: |
} other { { HAS_UNREAD_AND_NEW, select,
are <a href='{basePath}/u/{username}/messages/group/{groupName}/unread'># unread</a> 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 { # This string uses the ICU Message Format. See https://meta.discourse.org/t/7035 for translation guidelines.
UNREAD, plural, #
=0 {} # Both UNREAD and NEW are greater than 0 when HAS_UNREAD_AND_NEW is true
one { # Either UNREAD or NEW is greater than 0 when HAS_UNREAD_AND_NEW is false
is <a href='{basePath}/u/{username}/messages/unread'># unread</a> read_more_personal_pm_MF: |
} other { { HAS_UNREAD_AND_NEW, select,
are <a href='{basePath}/u/{username}/messages/unread'># unread</a> 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: preferences_nav:
account: "Account" account: "Account"
@ -1893,30 +1929,36 @@ en:
logout_disabled: "Logout is disabled while the site is in read only mode." logout_disabled: "Logout is disabled while the site is in read only mode."
staff_writes_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." 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: >- 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> 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 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 {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}} 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. 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: >- 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> 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 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}}. read and reply to we recommend at least {requiredTopics, plural, one {<strong>#</strong> topic} other {<strong>#</strong> topics}}.
Only staff can see this message. 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: >- 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> 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 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}}. read and reply to we recommend at least {requiredPosts, plural, one {<strong>#</strong> post} other {<strong>#</strong> posts}}.
Only staff can see this message. Only staff can see this message.
logs_error_rate_notice: 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}}." 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}}." 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}}." 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}}." 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..." learn_more: "learn more..."
@ -1948,7 +1990,7 @@ en:
description: description:
one: "There is <b>%{count}</b> reply." one: "There is <b>%{count}</b> reply."
other: "There are <b>%{count}</b> replies." 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>." 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" enable: "Summarize This Topic"
disable: "Show All Posts" disable: "Show All Posts"
@ -2825,7 +2867,7 @@ en:
read_more: "Want to read more? %{catLink} or %{latestLink}." read_more: "Want to read more? %{catLink} or %{latestLink}."
unread_indicator: "No member has read the last post of this topic yet." 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 { read_more_MF: "There {
UNREAD, plural, UNREAD, plural,
=0 {} =0 {}
@ -2841,6 +2883,7 @@ en:
other { {BOTH, select, true{and } false {are } other{}} <a href='{basePath}/new'># new</a> topics} 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 {}}" } 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}" bumped_at_title_MF: "{FIRST_POST}: {CREATED_AT}\n{LAST_POST}: {BUMPED_AT}"
browse_all_categories: Browse all categories browse_all_categories: Browse all categories
@ -3657,7 +3700,7 @@ en:
delete_spammer: "Delete Spammer" delete_spammer: "Delete Spammer"
flag_for_review: "Queue For Review" 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?" 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" yes_delete_spammer: "Yes, Delete Spammer"
ip_address_missing: "(N/A)" ip_address_missing: "(N/A)"
@ -3732,7 +3775,7 @@ en:
label: "Pending" label: "Pending"
label_with_count: "Pending (%{count})" 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: | posts_likes_MF: |
This topic has {count, plural, one {# reply} other {# replies}} {ratio, select, This topic has {count, plural, one {# reply} other {# replies}} {ratio, select,
low {with a high like to post ratio} low {with a high like to post ratio}
@ -5424,7 +5467,7 @@ en:
title: "Clear Penalty History" title: "Clear Penalty History"
description: "users with penalties cannot reach TL3" 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?" 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" silence: "Silence"
unsilence: "Unsilence" unsilence: "Unsilence"