Move translations from attributes-groups.json to realm-settings.json (#3788)

This commit is contained in:
Jon Koops 2022-11-18 12:25:13 +01:00 committed by GitHub
parent 59ccc0b084
commit 44891c14cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 48 additions and 52 deletions

View file

@ -1,27 +0,0 @@
{
"createGroupText": "Create attributes group",
"editGroupText": "Edit attributes group",
"tableTitle": "Attributes groups",
"columnName": "Name",
"columnDisplayName": "Display name",
"columnDisplayDescription": "Display description",
"emptyStateMessage": "No attributes groups",
"emptyStateInstructions": "If you want to add an attributes group click the button below.",
"deleteDialogTitle": "Delete attribute group?",
"deleteDialogDescription": "Are you sure you want to permanently delete the attributes group <1>{{group}}</1>?",
"deleteSuccess": "Attributes group deleted.",
"deleteError": "Could not delete user attributes group: {{error}}",
"nameField": "Name",
"nameHint": "A unique name for the group. This name will be used to reference the group when binding an attribute to a group.",
"displayHeaderField": "Display name",
"displayHeaderHint": "A user-friendly name for the group that should be used when rendering a group of attributes in user-facing forms. Supports keys for localized values as well. For example: ${profile.attribute.group.address}.",
"displayDescriptionField": "Display description",
"displayDescriptionHint": "A text that should be used as a tooltip when rendering user-facing forms.",
"annotationsText": "Annotations",
"addAnnotationText": "Add annotation",
"removeAnnotationText": "Remove annotation",
"keyPlaceholder": "Type a key",
"keyLabel": "Key",
"valuePlaceholder": "Type a value",
"valueLabel": "Value"
}

View file

@ -1,4 +1,28 @@
{ {
"createGroupText": "Create attributes group",
"editGroupText": "Edit attributes group",
"tableTitle": "Attributes groups",
"columnName": "Name",
"columnDisplayName": "Display name",
"columnDisplayDescription": "Display description",
"emptyStateMessage": "No attributes groups",
"emptyStateInstructions": "If you want to add an attributes group click the button below.",
"deleteDialogTitle": "Delete attribute group?",
"deleteDialogDescription": "Are you sure you want to permanently delete the attributes group <1>{{group}}</1>?",
"deleteSuccess": "Attributes group deleted.",
"deleteAttributeGroupError": "Could not delete user attributes group: {{error}}",
"nameField": "Name",
"nameHint": "A unique name for the group. This name will be used to reference the group when binding an attribute to a group.",
"displayHeaderField": "Display name",
"displayHeaderHint": "A user-friendly name for the group that should be used when rendering a group of attributes in user-facing forms. Supports keys for localized values as well. For example: ${profile.attribute.group.address}.",
"displayDescriptionField": "Display description",
"displayDescriptionHint": "A text that should be used as a tooltip when rendering user-facing forms.",
"annotationsText": "Annotations",
"removeAnnotationText": "Remove annotation",
"keyPlaceholder": "Type a key",
"keyLabel": "Key",
"valuePlaceholder": "Type a value",
"valueLabel": "Value",
"realmSettingsExplain": "Realm settings are settings that control the options for users, applications, roles, and groups in the current realm.", "realmSettingsExplain": "Realm settings are settings that control the options for users, applications, roles, and groups in the current realm.",
"partialImport": "Partial import", "partialImport": "Partial import",
"partialExport": "Partial export", "partialExport": "Partial export",

View file

@ -34,7 +34,6 @@ const initOptions = async (
ns: [ ns: [
"common", "common",
"common-help", "common-help",
"attributes-group",
"dashboard", "dashboard",
"clients", "clients",
"clients-help", "clients-help",

View file

@ -11,7 +11,7 @@ export type EditAttributesGroupParams = {
export const EditAttributesGroupRoute: RouteDef = { export const EditAttributesGroupRoute: RouteDef = {
path: "/:realm/realm-settings/user-profile/attributesGroup/edit/:name", path: "/:realm/realm-settings/user-profile/attributesGroup/edit/:name",
component: lazy(() => import("../user-profile/AttributesGroupDetails")), component: lazy(() => import("../user-profile/AttributesGroupDetails")),
breadcrumb: (t) => t("attributes-group:editGroupText"), breadcrumb: (t) => t("realm-settings:editGroupText"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -10,7 +10,7 @@ export type NewAttributesGroupParams = {
export const NewAttributesGroupRoute: RouteDef = { export const NewAttributesGroupRoute: RouteDef = {
path: "/:realm/realm-settings/user-profile/attributesGroup/new", path: "/:realm/realm-settings/user-profile/attributesGroup/new",
component: lazy(() => import("../user-profile/AttributesGroupDetails")), component: lazy(() => import("../user-profile/AttributesGroupDetails")),
breadcrumb: (t) => t("attributes-group:createGroupText"), breadcrumb: (t) => t("realm-settings:createGroupText"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -109,23 +109,23 @@ export default function AttributesGroupForm() {
<ViewHeader <ViewHeader
titleKey={ titleKey={
matchingGroup matchingGroup
? "attributes-group:editGroupText" ? "realm-settings:editGroupText"
: "attributes-group:createGroupText" : "realm-settings:createGroupText"
} }
divider divider
/> />
<PageSection variant="light" onSubmit={form.handleSubmit(onSubmit)}> <PageSection variant="light" onSubmit={form.handleSubmit(onSubmit)}>
<FormAccess isHorizontal role="manage-realm"> <FormAccess isHorizontal role="manage-realm">
<FormGroup <FormGroup
label={t("attributes-group:nameField")} label={t("realm-settings:nameField")}
fieldId="kc-name" fieldId="kc-name"
isRequired isRequired
helperTextInvalid={t("common:required")} helperTextInvalid={t("common:required")}
validated={form.errors.name ? "error" : "default"} validated={form.errors.name ? "error" : "default"}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="attributes-group:nameHint" helpText="realm-settings:nameHint"
fieldLabelId="attributes-group:nameField" fieldLabelId="realm-settings:nameField"
/> />
} }
> >
@ -141,12 +141,12 @@ export default function AttributesGroupForm() {
)} )}
</FormGroup> </FormGroup>
<FormGroup <FormGroup
label={t("attributes-group:displayHeaderField")} label={t("realm-settings:displayHeaderField")}
fieldId="kc-display-header" fieldId="kc-display-header"
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="attributes-group:displayHeaderHint" helpText="realm-settings:displayHeaderHint"
fieldLabelId="attributes-group:displayHeaderField" fieldLabelId="realm-settings:displayHeaderField"
/> />
} }
> >
@ -158,12 +158,12 @@ export default function AttributesGroupForm() {
/> />
</FormGroup> </FormGroup>
<FormGroup <FormGroup
label={t("attributes-group:displayDescriptionField")} label={t("realm-settings:displayDescriptionField")}
fieldId="kc-display-description" fieldId="kc-display-description"
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="attributes-group:displayDescriptionHint" helpText="realm-settings:displayDescriptionHint"
fieldLabelId="attributes-group:displayDescriptionField" fieldLabelId="realm-settings:displayDescriptionField"
/> />
} }
> >
@ -175,10 +175,10 @@ export default function AttributesGroupForm() {
/> />
</FormGroup> </FormGroup>
<TextContent> <TextContent>
<Text component="h2">{t("attributes-group:annotationsText")}</Text> <Text component="h2">{t("realm-settings:annotationsText")}</Text>
</TextContent> </TextContent>
<FormGroup <FormGroup
label={t("attributes-group:annotationsText")} label={t("realm-settings:annotationsText")}
fieldId="kc-annotations" fieldId="kc-annotations"
> >
<FormProvider {...form}> <FormProvider {...form}>

View file

@ -19,7 +19,7 @@ import { useUserProfile } from "./UserProfileContext";
export const AttributesGroupTab = () => { export const AttributesGroupTab = () => {
const { config, save } = useUserProfile(); const { config, save } = useUserProfile();
const { t } = useTranslation("attributes-group"); const { t } = useTranslation("realm-settings");
const navigate = useNavigate(); const navigate = useNavigate();
const { realm } = useRealm(); const { realm } = useRealm();
const [key, setKey] = useState(0); const [key, setKey] = useState(0);
@ -33,9 +33,9 @@ export const AttributesGroupTab = () => {
} }
const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({ const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({
titleKey: "attributes-group:deleteDialogTitle", titleKey: "realm-settings:deleteDialogTitle",
children: ( children: (
<Trans i18nKey="attributes-group:deleteDialogDescription"> <Trans i18nKey="realm-settings:deleteDialogDescription">
{" "} {" "}
<strong>{{ group: groupToDelete?.name }}</strong>. <strong>{{ group: groupToDelete?.name }}</strong>.
</Trans> </Trans>
@ -50,8 +50,8 @@ export const AttributesGroupTab = () => {
save( save(
{ ...config, groups }, { ...config, groups },
{ {
successMessageKey: "attributes-group:deleteSuccess", successMessageKey: "realm-settings:deleteSuccess",
errorMessageKey: "attributes-group:deleteError", errorMessageKey: "realm-settings:deleteAttributeGroupError",
} }
); );
}, },
@ -68,7 +68,7 @@ export const AttributesGroupTab = () => {
<KeycloakDataTable <KeycloakDataTable
key={key} key={key}
loader={loader} loader={loader}
ariaLabelKey="attributes-group:tableTitle" ariaLabelKey="realm-settings:tableTitle"
toolbarItem={ toolbarItem={
<ToolbarItem> <ToolbarItem>
<Button <Button
@ -83,7 +83,7 @@ export const AttributesGroupTab = () => {
columns={[ columns={[
{ {
name: "name", name: "name",
displayKey: "attributes-group:columnName", displayKey: "realm-settings:columnName",
cellRenderer: (group) => ( cellRenderer: (group) => (
<Link to={toEditAttributesGroup({ realm, name: group.name! })}> <Link to={toEditAttributesGroup({ realm, name: group.name! })}>
{group.name} {group.name}
@ -92,11 +92,11 @@ export const AttributesGroupTab = () => {
}, },
{ {
name: "displayHeader", name: "displayHeader",
displayKey: "attributes-group:columnDisplayName", displayKey: "realm-settings:columnDisplayName",
}, },
{ {
name: "displayDescription", name: "displayDescription",
displayKey: "attributes-group:columnDisplayDescription", displayKey: "realm-settings:columnDisplayDescription",
}, },
]} ]}
actions={[ actions={[