langToLocale() handles `cz`, but the Czech language key is `cs`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- frontend, internationalization
Research direction
Read client/src/app/infrastructure/utils/lang-to-locale.ts and compare its Czech case with the language keys in client/src/app/domain/definitions/languages.ts and the existing Czech handling in langToTimeLocale(). Change the locale mapping to use the Czech language key; done means langToLocale('cs') returns cs-CZ instead of the fallback.
Written by the indexing model from the issue text.
Description
Describe the bug
langToLocale() in client/src/app/infrastructure/utils/lang-to-locale.ts has case `cz` , but the
client's language key for Czech is cs (client/src/app/domain/definitions/languages.ts:
en, de, cs, fr, it, es, nl, ru). langToTimeLocale() in the same file already uses cs
(date-fns/locale/cs). So with the language set to Czech, langToLocale('cs') falls through to the
default branch (lt-LT, an ISO-like date format) instead of cs-CZ.
How to Reproduce
- Set the interface language to Czech.
- Look at any formatted date/time that goes through
langToLocale(): it is rendered in the
fallbacklt-LTformat.
I could not test this with a Czech user account; it is from reading the code on main @ 551421b.
Expected behavior
Czech uses cs-CZ.
Additional context
One-word fix (case `cz` → case `cs` ), happy to open a PR:
diff --git a/client/src/app/infrastructure/utils/lang-to-locale.ts b/client/src/app/infrastructure/utils/lang-to-locale.ts
index f857b8f..58fbc51 100644
--- a/client/src/app/infrastructure/utils/lang-to-locale.ts
+++ b/client/src/app/infrastructure/utils/lang-to-locale.ts
@@ -15,7 +15,7 @@ export function langToLocale(lang: string): string {
case `de`: {
return `de-DE`;
}
- case `cz`: {
+ case `cs`: {
return `cs-CZ`;
}
default: {
Found while preparing a Portuguese (Brazil) translation. Reported by Marcos Aguiar ([email protected]).
- Dominant language
- TypeScript
- Stars
- 35
- Forks
- 53
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 49
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenSlides/openslides-client
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenSlides/openslides-client#6728 ·
Maintainers usually reply within 1 day
-
Creating a ballot not possible after switching poll method from "per list" to "per candidate"Possibly taken @emanuelschuetze claimed this 9 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenSlides/openslides-client#6680 ·
Maintainers usually reply within 1 day
-
Moderation note mat card: too much space title <--> contentPossibly taken @Borreg0 claimed this 5 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenSlides/openslides-client#6678 · 1 assignee ·
Maintainers usually reply within 1 day
-
Remove forward button from amendmentsPossibly taken @Borreg0 claimed this 5 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenSlides/openslides-client#6677 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenSlides/openslides-client#6254 ·
Maintainers usually reply within 1 day
All issues in OpenSlides/openslides-client
Similar issues
-
bug
Difficulty 2/5 Half a day Newbie friendliness 62/100
garethgeorge/backrest#1451 ·
Maintainers usually reply within 1 day
-
fix(core): \.pluck() returns values in key insertion order instead of requested argument orderPossibly taken @ManyaS-Git claimed this 1 day ago. Openstatus:in-linear
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
n8n-io/n8n#45027 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 13 days
-
bug
Difficulty 2/5 Half a day Newbie friendliness 68/100
navikt/skjemabygging-formio#2399 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lidofinance/validator-ejector#233 ·
Maintainers usually reply within 1 day