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

Handle "ru" language on Safari #2843

Closed
2 tasks done
sanchesfree opened this issue Feb 25, 2023 · 5 comments
Closed
2 tasks done

Handle "ru" language on Safari #2843

sanchesfree opened this issue Feb 25, 2023 · 5 comments
Labels
area:core issues describing changes to the core of uptime kuma feature-request Request for new features to be added

Comments

@sanchesfree
Copy link

sanchesfree commented Feb 25, 2023

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

In safari the locale is defined as "ru", but in Chrome it is "ru-RU".

Because of this on the status pages in safari the inscriptions are in English.

If you rename file src/lang/ru-RU.json to src/lang/ru.json, this language will be connected in both Chrome and Safari.
and change languageList key in /src/i18n.js from "ru-RU" to "ru"

👟 Reproduction steps

create status page. open page in safari

👀 Expected behavior

title from ru file "Все системы работают в штатном режиме"

😓 Actual Behavior

title from en file "All Systems Operational"

🐻 Uptime-Kuma Version

1.20.1

💻 Operating System and Arch

ubuntu

🌐 Browser

Safari 16.3

🐋 Docker Version

No response

🟩 NodeJS Version

No response

📝 Relevant log output

No response

@sanchesfree sanchesfree added the bug Something isn't working label Feb 25, 2023
@rezzorix
Copy link
Contributor

I just looked a bit through the locale file names and there is indeed no clear naming convention followed here for this…

Some are in format “language_Territory” some are not.

With regards to language Wwe should follow one standard - ideally one that is most compatible…

Is this issue for the Russian language isolated to this one only or for others as well?

@sanchesfree
Copy link
Author

I think it is enough to rename all locales to a two-letter format, because the first two letters denote the language and the rest is the dialect. It's not that important, most likely. For the Russian language, that's for sure.
Does British English or American English make a difference in this Web application? I don't think so.

Here are examples of locales

https://help.sap.com/docs/SAP_BUSINESSOBJECTS_BUSINESS_INTELLIGENCE_PLATFORM/09382741061c40a989fae01e61d54202/46758c5e6e041014910aba7db0e91070.html?version=4.2.4&locale=en-US

@louislam louislam added feature-request Request for new features to be added and removed bug Something isn't working labels Feb 26, 2023
@louislam
Copy link
Owner

Currently, it depends on a single variable navigator.language, so if changed it, I think Chrome will be not working anymore.

|| languageList[navigator.language] && navigator.language

I think it should be handled in code like: if navigator.language == "ru", then current language = "ru-RU"

Or change to use navigator.languages (with s), but I still not sure whether it is in the list, you can check it on:
https://jsfiddle.net/a6cbdq8u/

Some are in format “language_Territory” some are not.

I checked on Weblate, they do provide both formats, I think it is part of ISO standards.

I think it is enough to rename all locales to a two-letter format

Incorrect for zh-* and many other languages, they are pretty different.

@louislam louislam changed the title Rename file src/lang/ru-RU.json to src/lang/ru.json Handle "ru" language on Safari Feb 26, 2023
@sanchesfree
Copy link
Author

Why not rename lang file ru-RU to ru and change key in array to ru ?

Judging by this code, both ru and ru-RU will be processed in the end
uptime-kuma/src/i18n.js

@CommanderStorm CommanderStorm added the area:core issues describing changes to the core of uptime kuma label Dec 7, 2023
@CommanderStorm
Copy link
Collaborator

#4244 was merged into the 1.23.12 bugfix release (and will thus be included in future releases)
=> closing as resolved by looking at navigator.languages instead of navigator.language

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core issues describing changes to the core of uptime kuma feature-request Request for new features to be added
Projects
None yet
Development

No branches or pull requests

4 participants