Pluralise counts properly instead of writing dag(ar)

The translate function learns a {count|singular|plural} form, and the
24 strings that hedged with "dag(ar)", "day(s)" or "week(s)" now pick
the right word from the number they interpolate, in both languages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XBRLomdLK9jF7wU7a8AA6H
This commit is contained in:
2026-09-20 08:06:27 +02:00
parent ddb65018dd
commit 411612c86c
9 changed files with 124 additions and 31 deletions
+2 -2
View File
@@ -1166,7 +1166,7 @@ describe('Calendar', () => {
const toast = await screen.findByTestId('calendar-toast')
expect(toast).toHaveTextContent('7')
expect(toast).toHaveTextContent('dagarna')
expect(toast).toHaveTextContent('dagar')
expect(toast).not.toHaveTextContent('3 vecko')
expect(toast).not.toHaveTextContent('veckorna')
})
@@ -1218,7 +1218,7 @@ describe('Calendar', () => {
fireEvent.click(screen.getByTestId('preset-click'))
const toast = await screen.findByTestId('calendar-toast')
// What changed (existing "N day(s) changed" summary) ...
// What changed (the "N days changed" summary with pluralization) ...
expect(toast).toHaveTextContent('ändrades')
// ... and what fell short.
expect(toast).toHaveTextContent('5')