fix i18n in role change dialog

This commit is contained in:
Josh Hawkins 2025-04-16 21:29:11 -05:00 committed by Nicolas Mowen
parent 4ed00f22c5
commit 76f1170b80
2 changed files with 27 additions and 6 deletions

View File

@ -483,8 +483,14 @@
}, },
"changeRole": { "changeRole": {
"title": "Change User Role", "title": "Change User Role",
"desc": "Update permissions for <span className=\"font-medium\">{{username}}</span>", "desc": "Update permissions for",
"roleInfo": "<p>Select the appropriate role for this user:</p><ul className=\"mt-2 space-y-1 pl-5\"><li> • <span className=\"font-medium\">Admin:</span> Full access to all features. </li><li> • <span className=\"font-medium\">Viewer:</span> Limited to Live dashboards, Review, Explore, and Exports only.</li></ul>" "roleInfo": {
"intro": "Select the appropriate role for this user:",
"admin": "Admin",
"adminDesc": "Full access to all features.",
"viewer": "Viewer",
"viewerDesc": "Limited to Live dashboards, Review, Explore, and Exports only."
}
} }
} }
}, },

View File

@ -1,4 +1,4 @@
import { Trans, useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Button } from "../ui/button"; import { Button } from "../ui/button";
import { import {
Dialog, Dialog,
@ -46,13 +46,28 @@ export default function RoleChangeDialog({
{t("users.dialog.changeRole.title")} {t("users.dialog.changeRole.title")}
</DialogTitle> </DialogTitle>
<DialogDescription> <DialogDescription>
{t("users.dialog.changeRole.desc", { username })} {t("users.dialog.changeRole.desc")}
<span className="font-medium"> {username}</span>
</DialogDescription> </DialogDescription>
</DialogHeader> </DialogHeader>
<div className="py-6"> <div className="py-3">
<div className="mb-4 text-sm text-muted-foreground"> <div className="mb-4 text-sm text-muted-foreground">
<Trans ns="views/settings">users.dialog.changeRole.roleInfo</Trans> <p>{t("users.dialog.changeRole.roleInfo.intro")}</p>
<ul className="mt-2 list-disc space-y-1 pl-5">
<li>
<span className="font-medium">
{t("users.dialog.changeRole.roleInfo.admin")}
</span>
: {t("users.dialog.changeRole.roleInfo.adminDesc")}
</li>
<li>
<span className="font-medium">
{t("users.dialog.changeRole.roleInfo.viewer")}
</span>
: {t("users.dialog.changeRole.roleInfo.viewerDesc")}
</li>
</ul>
</div> </div>
<Select <Select