mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
feat: add translations for permission sections and actions
Translate all permission section names (users, tickets, etc.) and action names (read, edit, delete, etc.) in ru/en/zh/fa locales. Apply translations in PermissionMatrix, PolicyEdit, and Policies list.
This commit is contained in:
@@ -360,12 +360,17 @@ export default function AdminPolicies() {
|
||||
|
||||
{/* Resource + actions */}
|
||||
<div className="mb-2 flex flex-wrap items-center gap-2 text-sm">
|
||||
<span className="rounded bg-dark-700 px-2 py-0.5 font-mono text-xs text-accent-400">
|
||||
{policy.resource}
|
||||
<span className="rounded bg-dark-700 px-2 py-0.5 text-xs text-accent-400">
|
||||
{t(
|
||||
`admin.roles.form.permissionSections.${policy.resource}`,
|
||||
policy.resource,
|
||||
)}
|
||||
</span>
|
||||
<span className="text-dark-500">:</span>
|
||||
<span className="font-mono text-xs text-dark-300">
|
||||
{(policy.actions ?? []).join(', ')}
|
||||
<span className="text-xs text-dark-300">
|
||||
{(policy.actions ?? [])
|
||||
.map((a) => t(`admin.roles.form.permissionActions.${a}`, a))
|
||||
.join(', ')}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ export default function AdminPolicyEdit() {
|
||||
<option value="">{t('admin.policies.form.selectResource')}</option>
|
||||
{permissionRegistry?.map((section) => (
|
||||
<option key={section.section} value={section.section}>
|
||||
{section.section}
|
||||
{t(`admin.roles.form.permissionSections.${section.section}`, section.section)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
@@ -500,7 +500,7 @@ export default function AdminPolicyEdit() {
|
||||
}`}
|
||||
aria-pressed={selected}
|
||||
>
|
||||
{action}
|
||||
{t(`admin.roles.form.permissionActions.${action}`, action)}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -174,7 +174,9 @@ function PermissionMatrix({
|
||||
onClick={() => toggleExpand(section.section)}
|
||||
className="flex flex-1 items-center justify-between"
|
||||
>
|
||||
<span className="text-sm font-medium text-dark-200">{section.section}</span>
|
||||
<span className="text-sm font-medium text-dark-200">
|
||||
{t(`admin.roles.form.permissionSections.${section.section}`, section.section)}
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-xs text-dark-500">
|
||||
{section.actions.filter((a) => isPermSelected(section.section, a)).length}/
|
||||
@@ -208,7 +210,7 @@ function PermissionMatrix({
|
||||
}`}
|
||||
aria-pressed={selected}
|
||||
>
|
||||
{action}
|
||||
{t(`admin.roles.form.permissionActions.${action}`, action)}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user