added lang support to view pages
This commit is contained in:
1 parent
a0ed9a702c
commit
a26e788415
25 files changed
+1213
-610
No files matched your search
@@ -100,7 +100,7 @@ export default function LoanTypeViewPage() {
|
||||
|
||||
{/* Detail section */}
|
||||
<Section>
|
||||
<InfoRow label="ID" value={data.id} />
|
||||
<InfoRow label={t('common.id', 'ID')} value={data.id} />
|
||||
|
||||
{/* Multilingual name rows */}
|
||||
<div className="grid grid-cols-[220px_1fr] items-start py-2.5 px-4 border-b border-border">
|
||||
|
||||
@@ -70,7 +70,7 @@ export default function RequiredDocumentsViewPage() {
|
||||
|
||||
{/* Main info */}
|
||||
<Section>
|
||||
<InfoRow label="ID" value={data.id} />
|
||||
<InfoRow label={t('common.id', 'ID')} value={data.id} />
|
||||
|
||||
{/* Name — multilingual */}
|
||||
<div className="grid grid-cols-[220px_1fr] items-start py-2.5 px-4 border-b border-border">
|
||||
@@ -81,7 +81,7 @@ export default function RequiredDocumentsViewPage() {
|
||||
{(['tk', 'ru', 'en'] as const).map((lang) => (
|
||||
<div key={lang}>
|
||||
<span className="text-xs font-semibold text-muted-foreground uppercase tracking-wider block mb-0.5">
|
||||
{lang === 'tk' ? 'Türkmen' : lang === 'ru' ? 'Русский' : 'English'}
|
||||
{t(lang === 'tk' ? 'languages.tk' : lang === 'ru' ? 'languages.ru' : 'languages.en', lang === 'tk' ? 'Türkmen' : lang === 'ru' ? 'Русский' : 'English')}
|
||||
</span>
|
||||
<span className="text-sm text-foreground">{data.name[lang] || '—'}</span>
|
||||
</div>
|
||||
@@ -98,7 +98,7 @@ export default function RequiredDocumentsViewPage() {
|
||||
{(['tk', 'ru', 'en'] as const).map((lang) => (
|
||||
<div key={lang}>
|
||||
<span className="text-xs font-semibold text-muted-foreground uppercase tracking-wider block mb-1">
|
||||
{lang === 'tk' ? 'Türkmen' : lang === 'ru' ? 'Русский' : 'English'}
|
||||
{t(lang === 'tk' ? 'languages.tk' : lang === 'ru' ? 'languages.ru' : 'languages.en', lang === 'tk' ? 'Türkmen' : lang === 'ru' ? 'Русский' : 'English')}
|
||||
</span>
|
||||
{data.description[lang] ? (
|
||||
<div
|
||||
|
||||
@@ -21,12 +21,6 @@ import { usePermission, useDeletePermission } from '@/features/permissions/hooks
|
||||
|
||||
type LangKey = 'tk' | 'ru' | 'en'
|
||||
|
||||
const LANG_TABS: { key: LangKey; label: string }[] = [
|
||||
{ key: 'tk', label: 'Türkmen' },
|
||||
{ key: 'ru', label: 'Русский' },
|
||||
{ key: 'en', label: 'English' },
|
||||
]
|
||||
|
||||
function LangTabs({
|
||||
active,
|
||||
onChange,
|
||||
@@ -34,6 +28,12 @@ function LangTabs({
|
||||
active: LangKey
|
||||
onChange: (l: LangKey) => void
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
const LANG_TABS: { key: LangKey; label: string }[] = [
|
||||
{ key: 'tk', label: t('languages.tk', 'Türkmen') },
|
||||
{ key: 'ru', label: t('languages.ru', 'Русский') },
|
||||
{ key: 'en', label: t('languages.en', 'English') },
|
||||
]
|
||||
return (
|
||||
<div className="flex gap-1 justify-end mb-2">
|
||||
{LANG_TABS.map((tab) => (
|
||||
@@ -130,7 +130,7 @@ export default function PermissionViewPage() {
|
||||
|
||||
{/* Detail section */}
|
||||
<Section>
|
||||
<InfoRow label="ID" value={permission.id} />
|
||||
<InfoRow label={t('common.id', 'ID')} value={permission.id} />
|
||||
<InfoRow label={t('permissions.fields.code', 'Kod')} value={permission.code} />
|
||||
|
||||
{/* Name row — with lang switcher */}
|
||||
|
||||
Reference in new issue
Block a user