Closed
Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
translations
Describe the bug
FolderTheme does not support Locales with extensions, such as de-x-informal.
This is a regression, and was introduced with 748c53d. The regexp LEGAL_LOCALE
does not contain a hash, but Locale.toString produces hashes for extensions.
Version
23.0.7
Regression
- The issue is a regression
Expected behavior
Keycloak should support all Locales for bundles.
Actual behavior
Login page shows an error when called with locales with extensions.
How to Reproduce?
- Add de-x-informal to realm
- Access the login page for this realm and switch language to de-x-informal
- Login page shows as error and the backend logs an exception:
Exception:
"loggerName": "org.keycloak.services.error.KeycloakErrorHandler",
"exception": {
"refId": 1,
"message": "Found illegal characters in locale or bundle name: messages_de__#x-informal",
"exceptionType": "java.lang.RuntimeException",
"frames": [
{
"line": 123,
"method": "getMessages",
"class": "org.keycloak.theme.FolderTheme"
},
{
"class": "org.keycloak.theme.DefaultThemeManager$ExtendingTheme",
"method": "getMessagesByLocale",
"line": 263
},
Anything else?
I will follow up with a PR, adding the hash to LEGAL_LOCALE
and a test case.