8000 FolderTheme does not support Locales with extensions · Issue #27284 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
FolderTheme does not support Locales with extensions #27284
Closed
@aschei

Description

@aschei

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?

  1. Add de-x-informal to realm
  2. Access the login page for this realm and switch language to de-x-informal
  3. 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0