+
Skip to content

Fallback to English translations for unknown locale despite German being the realm default #40990

Open
@statist32

Description

@statist32

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

When requesting translations from a realm that has German and English enabled, and German set as the default language, Keycloak unexpectedly falls back to English when an unrecognized locale is used in the request.

Setup:

  • Realm has two enabled languages: German (de) and English (en)
  • German is configured as the default realm language

When requesting translations:

Version

26.3.0

Regression

  • The issue is a regression

Expected behavior

When an unrecognized or invalid locale is provided in the translation request, the fallback should default to the realm’s default language, which is German in this case.

In other words:

Actual behavior

Despite German being the default realm language, the request with an unknown locale:

This suggests that English is incorrectly being used as a hard fallback instead of respecting the configured realm default.

How to Reproduce?

  1. Configure a realm with:
  • Enabled languages: German and English
  • Default language: German
  1. Request translations using a valid language code:
http://127.0.0.1:8080/resources/test/common/de

→ ✅ Returns German
3. Request translations using an invalid/unknown locale:

http://127.0.0.1:8080/resources/test/common/notExistingLanguage

→ ❌ Returns English instead of the default German

Anything else?

This fallback behavior appears to ignore the realm’s default language setting. English should not be assumed as the universal fallback in a multilingual setup. Instead, the fallback should respect the realm configuration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载