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

Hardcoded language when logged out #4557

Open
thany opened this issue Mar 24, 2025 · 0 comments
Open

Hardcoded language when logged out #4557

thany opened this issue Mar 24, 2025 · 0 comments
Labels
enhancement New feature or request PR welcome Good for new contributor

Comments

@thany
Copy link

thany commented Mar 24, 2025

Describe the bug

There seems to be a hardcoded language for logged out visitors set to "en", and I cannot find a way to set it to a different language from the settings, and also it doesn't try if browser language is supported. It just goes to English no matter what.

I tried a custom javascript snippet:

localStorage.setItem("locale", `"${navigator.language}"`);

And this doesn't work. First time visitors only get to see their language after a second refresh of the page. Probably this script gets executed too late. It should be executed before the site reads this localStorage value, but it gets executed afterwards.

Besides, this probably won't work well if the language of the browser doesn't have a translation in Memos. Not tested though.

The least I could probably hope for at this point, is an environment variable, if not a setting in the GUI. But that's still a bit naff, because I don't want to impose any single language upon my visitors. Why would I? That's what the available translations are for.

Steps to reproduce

Visit the site anonymously, with a browser that requests websites in a language other than English.

Actual result: website still displays in English
Expected result: try a supported matching language, and then revert to English as a last resort. And even that should be configurable.

The version of Memos you're using

0.24.0

Screenshots or additional context

NB: I'm calling this a bug, because it's a hardcoded user preference. That is a bug. It'd be a feature request if translations weren't a thing at all yet.

@thany thany added the bug Something isn't working label Mar 24, 2025
@github-actions github-actions bot added the Stale label Apr 8, 2025
@johnnyjoygh johnnyjoygh added enhancement New feature or request PR welcome Good for new contributor and removed bug Something isn't working Stale labels Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR welcome Good for new contributor
Projects
None yet
Development

No branches or pull requests

2 participants