Skip to content

Conversation

@rmetrich
Copy link

when CockpitLang is not set (the default when first logging in), the Language Dialog selects "en-us" even when the browser language is something else (e.g. PL, FR) and Cockpit already displays in that language.

when CockpitLang is not set (the default when first logging in), the
Language Dialog selects "en-us" even when the browser language is
something else (e.g. PL, FR) and Cockpit already displays in that
language.

Signed-off-by: Renaud Métrich <[email protected]>
@rmetrich
Copy link
Author

Hello, this patch fixes the dialog but not fully.
It appears that the dialog expects the full locale to be specified, not only the language, see dist/shell/manifest.json.
For example fr-fr. If you are in Canada, you will have fr-CA and this won't work. Nor will en-GB.
All the code related to language in Cockpit expects full locale.

@Venefilyn
Copy link
Member

Hello, this patch fixes the dialog but not fully. It appears that the dialog expects the full locale to be specified, not only the language, see dist/shell/manifest.json. For example fr-fr. If you are in Canada, you will have fr-CA and this won't work. Nor will en-GB. All the code related to language in Cockpit expects full locale.

Yeah that's why I'm wondering if this is a good idea atm. It feels like we need more robustness around this to make sure it takes the locale properly.

Looking at the code though, this seems to only set it for the modal itself but that is only during the selection phase. And even then since we may have languages that doesn't exist in Cockpit, such as fr-CA, it'll likely show as nothing selected. Likewise if browser is French and it selects it properly in the modal, the text and everything around it would still be en-us as we only update the locale when you click another language

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