mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
Only check required field when i18n dialog is open.
Fixes #41271 Fixes #41270 Signed-off-by: Stan Silvert <ssilvert@redhat.com>
This commit is contained in:
parent
6bce46c842
commit
322cbcdd84
@ -74,14 +74,6 @@ function hasTranslation(value: string, t: TFunction) {
|
||||
return t(value) === value && value !== "";
|
||||
}
|
||||
|
||||
function isTranslationRequired(
|
||||
value: string,
|
||||
t: TFunction,
|
||||
realm?: RealmRepresentation,
|
||||
) {
|
||||
return realm?.internationalizationEnabled && hasTranslation(value, t);
|
||||
}
|
||||
|
||||
export const TranslatableField = ({
|
||||
attributeName,
|
||||
prefix,
|
||||
@ -108,6 +100,16 @@ export const TranslatableField = ({
|
||||
}
|
||||
}, [value]);
|
||||
|
||||
function isTranslationRequired(
|
||||
value: string,
|
||||
t: TFunction,
|
||||
realm?: RealmRepresentation,
|
||||
) {
|
||||
return (
|
||||
realm?.internationalizationEnabled && open && hasTranslation(value, t)
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{isTranslationRequired(value, t, realm) && (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user