Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plural of "days" under EMS Status not working for Swedish #874

Closed
mvjt opened this issue Jan 1, 2023 · 7 comments
Closed

Plural of "days" under EMS Status not working for Swedish #874

mvjt opened this issue Jan 1, 2023 · 7 comments
Labels
bug Something isn't working
Milestone

Comments

@mvjt
Copy link

mvjt commented Jan 1, 2023

Bug description
It seems plural for "days" for EMS Status is not working for Swedish but works for other languages.
Day Singular = Dag
Day Plural = Dagar

In index.ts
NUM_DAYS: '{num} dag{{ar}}',

Screenshot where it should say "dagar" and not "dag"
image

Version: v3.5.0-dev.14

@mvjt mvjt added the bug Something isn't working label Jan 1, 2023
@MichaelDvP
Copy link
Contributor

I think this is because the pl base have no fixed part: NUM_DAYS: '{num} {{dni|dzień|dni|dni|dni}}',
Changing the pl to: NUM_DAYS: '{num} d{{ni|zień|ni|ni|ni}}', should work,
or set all other languages to NUM_DAYS: '{num} {{dag|dagar}}',

@mvjt
Copy link
Author

mvjt commented Jan 1, 2023

I think this is because the pl base have no fixed part: NUM_DAYS: '{num} {{dni|dzień|dni|dni|dni}}',
Changing the pl to: NUM_DAYS: '{num} d{{ni|zień|ni|ni|ni}}', should work,
or set all other languages to NUM_DAYS: '{num} {{dag|dagar}}',

Thanks Michael, I'm not sure I understand the syntax but I used the EN one as reference...

@proddy
Copy link
Contributor

proddy commented Jan 1, 2023

I think it's something else that is causing this. And it only happens in the Bus Status and only for SE. It renders correctly in the Dashboard for the "* burner operating time".

@MichaelDvP
Copy link
Contributor

For many days like in "burner operating time" the SE also renders correctly. And for minutes, hours also all languages work and PL defines cases for 1, 2, few, many, other languages only single/many. The only difference i see is that days are not defined as fixedpart/suffix, but use cases for each plural. My emsesp rarly reaches 2 days uptime without updating. Difficult to check.

@proddy
Copy link
Contributor

proddy commented Jan 1, 2023

yeah, this is a weird one and related to how the page is rendered are the variables loaded. I have a workaround which I'll push shortly.

@proddy
Copy link
Contributor

proddy commented Jan 1, 2023

I found the problem after tracing it down to internal JS library Intl.PluralRules. Turns out we're using the wrong locale for Swedish. It's SV and not SE (ISO 639). doh! Will do a PR...

https://www.loc.gov/standards/iso639-2/php/English_list.php

@proddy proddy added this to the v3.5.0 milestone Jan 1, 2023
proddy added a commit that referenced this issue Jan 1, 2023
@mvjt
Copy link
Author

mvjt commented Jan 1, 2023

Nice work. Translations finally look really good too. The only missing piece is #872.

MichaelDvP added a commit to MichaelDvP/EMS-ESP32 that referenced this issue Jan 2, 2023
@proddy proddy closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants