mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-25 16:42:34 +00:00
Better locale management in the admin console
Closes #39934 Signed-off-by: rmartinc <rmartinc@redhat.com>
This commit is contained in:
@@ -2888,6 +2888,7 @@ emptyPermissionInstructions=If you want to create a permission, please click the
|
||||
webAuthnPolicyAvoidSameAuthenticatorRegisterHelp=Avoid registering an authenticator that has already been registered.
|
||||
memberofLdapAttribute=Member-of LDAP attribute
|
||||
supportedLocales=Supported locales
|
||||
invalidLocale=Invalid locale selected
|
||||
showPasswordDataValue=Value
|
||||
webAuthnPolicyAttestationConveyancePreference=Attestation conveyance preference
|
||||
copyOf=Copy of {{name}}
|
||||
@@ -3490,4 +3491,4 @@ fullNameClaimHelp=The name of the claim from the JSON document returned by the u
|
||||
givenNameClaim=Given name Claim
|
||||
givenNameClaimHelp=The name of the claim from the JSON document returned by the user profile endpoint representing the user's given name. If not provided, defaults to `given_name`.
|
||||
familyNameClaim=Family name Claim
|
||||
familyNameClaimHelp=The name of the claim from the JSON document returned by the user profile endpoint representing the user's family name. If not provided, defaults to `family_name`.
|
||||
familyNameClaimHelp=The name of the claim from the JSON document returned by the user profile endpoint representing the user's family name. If not provided, defaults to `family_name`.
|
||||
|
||||
@@ -98,8 +98,15 @@ export const LocalizationTab = ({
|
||||
name="supportedLocales"
|
||||
isScrollable
|
||||
label={t("supportedLocales")}
|
||||
labelIcon={t("supportedLocalesHelp")}
|
||||
controller={{
|
||||
defaultValue: defaultSupportedLocales,
|
||||
rules: {
|
||||
required: t("required"),
|
||||
validate: (value: string[]) =>
|
||||
value.every((v) => allLocales.includes(v)) ||
|
||||
t("invalidLocale"),
|
||||
},
|
||||
}}
|
||||
variant="typeaheadMulti"
|
||||
placeholderText={t("selectLocales")}
|
||||
@@ -111,8 +118,14 @@ export const LocalizationTab = ({
|
||||
<SelectControl
|
||||
name="defaultLocale"
|
||||
label={t("defaultLocale")}
|
||||
labelIcon={t("defaultLocaleHelp")}
|
||||
controller={{
|
||||
defaultValue: DEFAULT_LOCALE,
|
||||
rules: {
|
||||
required: t("required"),
|
||||
validate: (value: string) =>
|
||||
watchSupportedLocales?.includes(value) || t("required"),
|
||||
},
|
||||
}}
|
||||
data-testid="select-default-locale"
|
||||
options={watchSupportedLocales!.map((l) => ({
|
||||
|
||||
@@ -564,7 +564,10 @@ public class ModelToRepresentation {
|
||||
}
|
||||
|
||||
rep.setInternationalizationEnabled(realm.isInternationalizationEnabled());
|
||||
rep.setSupportedLocales(realm.getSupportedLocalesStream().collect(Collectors.toSet()));
|
||||
Set<String> supportedLocales = realm.getSupportedLocalesStream().collect(Collectors.toSet());
|
||||
if (!supportedLocales.isEmpty()) {
|
||||
rep.setSupportedLocales(supportedLocales);
|
||||
}
|
||||
rep.setDefaultLocale(realm.getDefaultLocale());
|
||||
if (internal) {
|
||||
exportAuthenticationFlows(session, realm, rep);
|
||||
|
||||
Reference in New Issue
Block a user