Skip to content

Add de-CH variant to supported locales#191

Closed
Andre601 wants to merge 1 commit intokeepandroidopen:mainfrom
Andre601:patch-1
Closed

Add de-CH variant to supported locales#191
Andre601 wants to merge 1 commit intokeepandroidopen:mainfrom
Andre601:patch-1

Conversation

@Andre601
Copy link

@Andre601 Andre601 commented Mar 2, 2026

The banner does not display the german translation if your browser/os uses german with swiss grammar (de-CH), so I added it.
It's effectively the same as german itself, so if there's a simpler way for less duplication lmk.

@marcprux
Copy link
Collaborator

marcprux commented Mar 2, 2026

The problem with this change is that the locale for the banner will by default link to the localized version of the page, so this would go to https://keepandroidopen.org/de-CH/ (which doesn't exist).

A better solution would be for the logic in the banner to provide fallbacks, so if there's no "de-CH" key, then it falls back to checking "de".

@marcprux marcprux closed this in 4293d00 Mar 6, 2026
@marcprux
Copy link
Collaborator

marcprux commented Mar 6, 2026

I've implemented more robust locale detection in 4293d00, so "de-CH" should now fallback to "de". Please give it a try and reopen this PR (or create a new issue) if the locale still doesn't display correctly for you.

@Andre601
Copy link
Author

Andre601 commented Mar 6, 2026

Well... Not sure where or how exactly I should test it.

The keepandroidopen site seems to you hardcoded languages for the banner, so looking at it on the en page shows EN version and de obviously de...

I'm not really using it, as I don't have any project related, nor he cloud that would justify this, so I can't test it myself really...

Also, yes, I did check the banner page itself. And if that one is dynamic, then it's not working I'm afraid. And in that case could it maybe be the browser returning a different code for the language?

@marcprux
Copy link
Collaborator

marcprux commented Mar 6, 2026

Can you check the output of navigator.language in your browser's JavaScript console? If it is "de-CH", then the localized banner should be falling back to the "de" locale key…

Screenshot 2026-03-06 at 09 14 24

@Andre601
Copy link
Author

Andre601 commented Mar 6, 2026

grafik

Maybe it's a browser issue or privacy settings related?
I use Firefox, so there may be some things that it blocks or handles/returns differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants