added missin lang keys
This commit is contained in:
1 parent
a38d2615fd
commit
ad8d9528be
36 files changed
+949
-667
No files matched your search
@@ -47,7 +47,7 @@ export function BranchesListPage() {
|
||||
|
||||
const districtOptions = getDistrictOptions().map((d) => ({
|
||||
value: String(d.id),
|
||||
label: d.name.tk,
|
||||
label: d.name[lang],
|
||||
}))
|
||||
|
||||
const filterFields: FilterField[] = [
|
||||
@@ -84,7 +84,7 @@ export function BranchesListPage() {
|
||||
const columns: ColumnDef<Branch>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-mono text-sm font-medium">{row.original.id}</span>
|
||||
),
|
||||
|
||||
@@ -14,16 +14,15 @@ import {
|
||||
AlertDialogTitle,
|
||||
} from '@/components/ui/alert-dialog'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { Section, InfoRow } from '@/components/viewPageComponents'
|
||||
import { Section, InfoRow, MultiLangRow } from '@/components/viewPageComponents'
|
||||
import { useBranchById, useDeleteBranch } from '@/features/branches/hooks/useBranches'
|
||||
|
||||
export function BranchViewPage() {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const navigate = useNavigate()
|
||||
const { t, i18n } = useTranslation()
|
||||
const { t } = useTranslation()
|
||||
|
||||
const numericId = Number(id)
|
||||
const lang = (i18n.language?.slice(0, 2) ?? 'tk') as 'tk' | 'ru' | 'en'
|
||||
|
||||
const { data, isLoading } = useBranchById(numericId)
|
||||
const deleteMutation = useDeleteBranch()
|
||||
@@ -37,7 +36,7 @@ export function BranchViewPage() {
|
||||
<h1 className="text-2xl font-bold text-foreground">
|
||||
{isLoading
|
||||
? '...'
|
||||
: `${t('branches.view.title', 'Şahamça giňişleýin')}: ${data?.name[lang] ?? ''}`}
|
||||
: `${t('branches.viewTitle', 'Şahamça giňişleýin')}: ${data?.name.tk ?? ''}`}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@@ -77,33 +76,12 @@ export function BranchViewPage() {
|
||||
) : data ? (
|
||||
<>
|
||||
<Section title={t('branches.sections.basic', 'Esasy maglumatlar')}>
|
||||
<InfoRow label="ID" value={data.id} />
|
||||
<InfoRow label={t('common.id', 'ID')} value={data.id} />
|
||||
<InfoRow label={t('branches.fields.code', 'Kod')} value={data.code} />
|
||||
|
||||
<div className="grid grid-cols-[220px_1fr] items-start py-2.5 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground pt-1">
|
||||
{t('branches.fields.name', 'Ady')}
|
||||
</span>
|
||||
<div>
|
||||
<div className="flex gap-3 mb-2 justify-end">
|
||||
{(['tk', 'ru', 'en'] as const).map((l) => (
|
||||
<span
|
||||
key={l}
|
||||
className={`text-sm cursor-default ${
|
||||
l === lang
|
||||
? 'text-primary font-semibold underline underline-offset-4'
|
||||
: 'text-muted-foreground'
|
||||
}`}
|
||||
>
|
||||
{l === 'tk' ? 'Türkmen' : l === 'ru' ? 'Русский' : 'English'}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="text-sm text-foreground">{data.name[lang]}</span>
|
||||
</div>
|
||||
</div>
|
||||
<MultiLangRow label={t('branches.fields.name', 'Ady')} value={data.name} />
|
||||
|
||||
<InfoRow label={t('branches.fields.district', 'Etrap')} value={data.districtName[lang]} />
|
||||
<MultiLangRow label={t('branches.fields.district', 'Etrap')} value={data.districtName} />
|
||||
|
||||
<div className="grid grid-cols-[220px_1fr] items-center py-2.5 px-4">
|
||||
<span className="text-sm text-muted-foreground">
|
||||
@@ -118,28 +96,7 @@ export function BranchViewPage() {
|
||||
</Section>
|
||||
|
||||
<Section title={t('branches.sections.address', 'Salgy we habarlaşmak')}>
|
||||
<div className="grid grid-cols-[220px_1fr] items-start py-2.5 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground pt-1">
|
||||
{t('branches.fields.address', 'Salgy')}
|
||||
</span>
|
||||
<div>
|
||||
<div className="flex gap-3 mb-2 justify-end">
|
||||
{(['tk', 'ru', 'en'] as const).map((l) => (
|
||||
<span
|
||||
key={l}
|
||||
className={`text-sm cursor-default ${
|
||||
l === lang
|
||||
? 'text-primary font-semibold underline underline-offset-4'
|
||||
: 'text-muted-foreground'
|
||||
}`}
|
||||
>
|
||||
{l === 'tk' ? 'Türkmen' : l === 'ru' ? 'Русский' : 'English'}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="text-sm text-foreground">{data.address[lang]}</span>
|
||||
</div>
|
||||
</div>
|
||||
<MultiLangRow label={t('branches.fields.address', 'Salgy')} value={data.address} />
|
||||
<InfoRow label={t('branches.fields.phone', 'Telefon')} value={data.phone} />
|
||||
<InfoRow label={t('branches.fields.email', 'E-poçta')} value={data.email} />
|
||||
</Section>
|
||||
|
||||
@@ -68,7 +68,7 @@ export function DistrictsListPage() {
|
||||
const columns: ColumnDef<District>[] = [
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'ID',
|
||||
header: t('common.id', 'ID'),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-primary font-mono text-sm font-medium">{row.original.id}</span>
|
||||
),
|
||||
|
||||
@@ -14,16 +14,15 @@ import {
|
||||
AlertDialogTitle,
|
||||
} from '@/components/ui/alert-dialog'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { Section, InfoRow } from '@/components/viewPageComponents'
|
||||
import { Section, InfoRow, MultiLangRow } from '@/components/viewPageComponents'
|
||||
import { useDistrictById, useDeleteDistrict } from '@/features/districts/hooks/useDistricts'
|
||||
|
||||
export function DistrictViewPage() {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const navigate = useNavigate()
|
||||
const { t, i18n } = useTranslation()
|
||||
const { t } = useTranslation()
|
||||
|
||||
const numericId = Number(id)
|
||||
const lang = (i18n.language?.slice(0, 2) ?? 'tk') as 'tk' | 'ru' | 'en'
|
||||
|
||||
const { data, isLoading } = useDistrictById(numericId)
|
||||
const deleteMutation = useDeleteDistrict()
|
||||
@@ -37,7 +36,7 @@ export function DistrictViewPage() {
|
||||
<h1 className="text-2xl font-bold text-foreground">
|
||||
{isLoading
|
||||
? '...'
|
||||
: `${t('districts.view.title', 'Etrap giňişleýin')}: ${data?.name[lang] ?? ''}`}
|
||||
: `${t('districts.viewTitle', 'Etrap giňişleýin')}: ${data?.name.tk ?? ''}`}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@@ -76,30 +75,9 @@ export function DistrictViewPage() {
|
||||
</div>
|
||||
) : data ? (
|
||||
<Section>
|
||||
<InfoRow label="ID" value={data.id} />
|
||||
<InfoRow label={t('common.id', 'ID')} value={data.id} />
|
||||
|
||||
<div className="grid grid-cols-[220px_1fr] items-start py-2.5 px-4 border-b border-border">
|
||||
<span className="text-sm text-muted-foreground pt-1">
|
||||
{t('districts.fields.name', 'Ady')}
|
||||
</span>
|
||||
<div>
|
||||
<div className="flex gap-3 mb-2 justify-end">
|
||||
{(['tk', 'ru', 'en'] as const).map((l) => (
|
||||
<span
|
||||
key={l}
|
||||
className={`text-sm cursor-default ${
|
||||
l === lang
|
||||
? 'text-primary font-semibold underline underline-offset-4'
|
||||
: 'text-muted-foreground'
|
||||
}`}
|
||||
>
|
||||
{l === 'tk' ? 'Türkmen' : l === 'ru' ? 'Русский' : 'English'}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="text-sm text-foreground">{data.name[lang]}</span>
|
||||
</div>
|
||||
</div>
|
||||
<MultiLangRow label={t('districts.fields.name', 'Ady')} value={data.name} />
|
||||
|
||||
<InfoRow
|
||||
label={t('districts.fields.description', 'Bellikler')}
|
||||
|
||||
Reference in new issue
Block a user