Skip to content

Commit a886353

Browse files
committed
Keep whole sentences inside plural forms
Three messages split their sentence across the plural braces, leaving the fixed half outside: "You have {count, plural, ...}", "{count, plural, ...} what the challenge suggests.", and "{count, plural, ...} {action}". English tolerates that because the fragment never changes, but a translator working in a language whose word order or agreement depends on the count cannot move or inflect a fragment that sits outside the form they are translating. Each plural form now carries the whole sentence, so every language can put the count wherever it belongs.
1 parent c75d9e3 commit a886353

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/components/Pages/TeamsPage/PendingInvitesSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const PendingInvitesSection = ({ invites }: Props) => {
4242
{t(
4343
'teams.pendingInvites.count',
4444
{ count: invites.length },
45-
'You have {count, plural, one {# pending invitation} other {# pending invitations}}'
45+
'{count, plural, one {You have # pending invitation} other {You have # pending invitations}}'
4646
)}
4747
</h2>
4848
<ul className="space-y-2">

src/components/TaskInfoPanel/TaskTab/EditorChangesPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const EditorChangesPanel = ({ task }: { task: Task }) => {
103103
? t(
104104
'taskInfoPanel.editorChanges.diverged',
105105
{ count: editor?.divergedTagFixCount ?? 0 },
106-
'{count, plural, one {# element no longer matches} other {# elements no longer match}} what the challenge suggests.'
106+
'{count, plural, one {# element no longer matches what the challenge suggests.} other {# elements no longer match what the challenge suggests.}}'
107107
)
108108
: t(
109109
'taskInfoPanel.editorChanges.matches',

src/contexts/NotificationsContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const NotificationsProvider = ({ children }: { children: ReactNode }) =>
7979
t(
8080
'notifications.toast.actionSuccess',
8181
{ count, action },
82-
'{count, plural, one {# notification} other {# notifications}} {action}'
82+
'{count, plural, one {# notification {action}} other {# notifications {action}}}'
8383
)
8484
)
8585
setLoadingId?.(null)

src/i18n/messages/en-US.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@
838838
"notifications.actions.markedAsRead": "marked as read",
839839
"notifications.actions.markedAsUnread": "marked as unread",
840840
"notifications.toast.actionError": "Failed to {verb} notification: {message}",
841-
"notifications.toast.actionSuccess": "{count, plural, one {# notification} other {# notifications}} {action}",
841+
"notifications.toast.actionSuccess": "{count, plural, one {# notification {action}} other {# notifications {action}}}",
842842
"notificationsPage.content.description": "View and manage your notifications",
843843
"notificationsPage.content.groupByTask": "Group by Task",
844844
"notificationsPage.content.groupByTaskHint": "Notifications for the same task are grouped together",
@@ -1300,7 +1300,7 @@
13001300
"taskInfoPanel.data.viewOnOsm": "View {type} on OpenStreetMap",
13011301
"taskInfoPanel.drawer.startTask": "Start Task",
13021302
"taskInfoPanel.editorChanges.description": "Everything currently pending in the editor. Save from the editor to send it to OpenStreetMap.",
1303-
"taskInfoPanel.editorChanges.diverged": "{count, plural, one {# element no longer matches} other {# elements no longer match}} what the challenge suggests.",
1303+
"taskInfoPanel.editorChanges.diverged": "{count, plural, one {# element no longer matches what the challenge suggests.} other {# elements no longer match what the challenge suggests.}}",
13041304
"taskInfoPanel.editorChanges.docsLink": "About tag fix challenges",
13051305
"taskInfoPanel.editorChanges.matches": "These elements match what the challenge suggests.",
13061306
"taskInfoPanel.editorChanges.reset": "Reset",
@@ -1471,7 +1471,7 @@
14711471
"teams.pendingInvites.acceptButton": "Accept",
14721472
"teams.pendingInvites.acceptError": "Could not accept invitation",
14731473
"teams.pendingInvites.acceptSuccess": "Invitation accepted",
1474-
"teams.pendingInvites.count": "You have {count, plural, one {# pending invitation} other {# pending invitations}}",
1474+
"teams.pendingInvites.count": "{count, plural, one {You have # pending invitation} other {You have # pending invitations}}",
14751475
"teams.pendingInvites.declineButton": "Decline",
14761476
"teams.pendingInvites.declineError": "Could not decline invitation",
14771477
"teams.pendingInvites.declineSuccess": "Invitation declined",

0 commit comments

Comments
 (0)