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.",
"partialImport": "Partial import",
"partialExport": "Partial export",

View file

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

View file

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

View file

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

View file

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

View file

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