update other pages with russian translation

This commit is contained in:
maxim
2025-02-19 15:34:43 +03:00
parent fbf1b443fd
commit 5aee851f58
33 changed files with 267 additions and 222 deletions

View File

@ -25,7 +25,7 @@ export const SightCreate = () => {
<Box component="form" sx={{display: 'flex', flexDirection: 'column'}} autoComplete="off">
<TextField
{...register('name', {
required: 'This field is required',
required: 'Это поле является обязательным',
})}
error={!!(errors as any)?.name}
helperText={(errors as any)?.name?.message}
@ -33,12 +33,12 @@ export const SightCreate = () => {
fullWidth
InputLabelProps={{shrink: true}}
type="text"
label={'Name'}
label={'Название'}
name="name"
/>
<TextField
{...register('latitude', {
required: 'This field is required',
required: 'Это поле является обязательным',
valueAsNumber: true,
})}
error={!!(errors as any)?.latitude}
@ -47,12 +47,12 @@ export const SightCreate = () => {
fullWidth
InputLabelProps={{shrink: true}}
type="number"
label={'Latitude'}
label={'Широта'}
name="latitude"
/>
<TextField
{...register('longitude', {
required: 'This field is required',
required: 'Это поле является обязательным',
valueAsNumber: true,
})}
error={!!(errors as any)?.longitude}
@ -61,14 +61,14 @@ export const SightCreate = () => {
fullWidth
InputLabelProps={{shrink: true}}
type="number"
label={'Longitude'}
label={'Долгота'}
name="longitude"
/>
<Controller
control={control}
name="city_id"
rules={{required: 'This field is required'}}
rules={{required: 'Это поле является обязательным'}}
defaultValue={null}
render={({field}) => (
<Autocomplete
@ -83,7 +83,7 @@ export const SightCreate = () => {
isOptionEqualToValue={(option, value) => {
return option.id === value?.id
}}
renderInput={(params) => <TextField {...params} label="Select City" margin="normal" variant="outlined" error={!!errors.city_id} helperText={(errors as any)?.city_id?.message} required />}
renderInput={(params) => <TextField {...params} label="Выберите город" margin="normal" variant="outlined" error={!!errors.city_id} helperText={(errors as any)?.city_id?.message} required />}
/>
)}
/>

View File

@ -20,7 +20,7 @@ export const SightEdit = () => {
<Box component="form" sx={{display: 'flex', flexDirection: 'column'}} autoComplete="off">
<TextField
{...register('name', {
required: 'This field is required',
required: 'Это поле является обязательным',
})}
error={!!(errors as any)?.name}
helperText={(errors as any)?.name?.message}
@ -28,12 +28,12 @@ export const SightEdit = () => {
fullWidth
InputLabelProps={{shrink: true}}
type="text"
label={'Name'}
label={'Название'}
name="name"
/>
<TextField
{...register('latitude', {
required: 'This field is required',
required: 'Это поле является обязательным',
valueAsNumber: true,
})}
error={!!(errors as any)?.latitude}
@ -42,12 +42,12 @@ export const SightEdit = () => {
fullWidth
InputLabelProps={{shrink: true}}
type="number"
label={'Latitude'}
label={'Широта'}
name="latitude"
/>
<TextField
{...register('longitude', {
required: 'This field is required',
required: 'Это поле является обязательным',
valueAsNumber: true,
})}
error={!!(errors as any)?.longitude}
@ -56,13 +56,13 @@ export const SightEdit = () => {
fullWidth
InputLabelProps={{shrink: true}}
type="number"
label={'Longitude'}
label={'Долгота'}
name="longitude"
/>
<Controller
control={control}
name="city_id"
rules={{required: 'This field is required'}}
rules={{required: 'Это поле является обязательным'}}
defaultValue={null}
render={({field}) => (
<Autocomplete
@ -77,7 +77,7 @@ export const SightEdit = () => {
isOptionEqualToValue={(option, value) => {
return option.id === value?.id
}}
renderInput={(params) => <TextField {...params} label="Select City" margin="normal" variant="outlined" error={!!errors.city_id} helperText={(errors as any)?.city_id?.message} required />}
renderInput={(params) => <TextField {...params} label="Выберите город" margin="normal" variant="outlined" error={!!errors.city_id} helperText={(errors as any)?.city_id?.message} required />}
/>
)}
/>

View File

@ -20,16 +20,16 @@ export const SightList = () => {
},
{
field: 'name',
headerName: 'Name',
headerName: 'Название',
type: 'string',
minWidth: 200,
minWidth: 150,
display: 'flex',
align: 'left',
headerAlign: 'left',
},
{
field: 'latitude',
headerName: 'Latitude',
headerName: 'Широта',
type: 'number',
minWidth: 150,
display: 'flex',
@ -38,7 +38,7 @@ export const SightList = () => {
},
{
field: 'longitude',
headerName: 'Longitude',
headerName: 'Долгота',
type: 'number',
minWidth: 150,
display: 'flex',
@ -47,7 +47,7 @@ export const SightList = () => {
},
{
field: 'city_id',
headerName: 'City ID',
headerName: 'ID города',
type: 'number',
minWidth: 70,
display: 'flex',
@ -57,7 +57,7 @@ export const SightList = () => {
},
{
field: 'actions',
headerName: 'Actions',
headerName: 'Действия',
align: 'right',
headerAlign: 'center',
minWidth: 120,

View File

@ -97,11 +97,11 @@ export const SightShow = () => {
}
const fields = [
{label: 'ID', data: 'id'},
{label: 'Name', data: 'name'},
{label: 'Latitude', data: 'latitude'},
{label: 'Longitude', data: 'longitude'},
{label: 'City ID', data: 'city_id'},
// {label: 'ID', data: 'id'},
{label: 'Название', data: 'name'},
{label: 'Широта', data: 'latitude'},
{label: 'Долгота', data: 'longitude'},
{label: 'ID города', data: 'city_id'},
]
return (
@ -118,46 +118,41 @@ export const SightShow = () => {
<Stack gap={2}>
<Typography variant="body1" fontWeight="bold">
Linked Articles
Привязанные статьи
</Typography>
<Grid container gap={2}>
{articlesLoading ? (
<Typography>Loading articles...</Typography>
<Typography>Загрузка статей...</Typography>
) : linkedArticles.length > 0 ? (
linkedArticles.map((article) => (
<Box key={article.id} sx={{border: '2px solid #dddddd25', padding: '20px', marginBottom: '8px'}}>
<Stack gap={0.5}>
<Typography>
<strong>ID:</strong> {article.id}
</Typography>
<Typography>
<strong>Heading:</strong> {article.heading}
</Typography>
<Typography>
<strong>Body:</strong> {article.body}
<Stack gap={1}>
<Typography variant="h5">
<strong>{article.heading}</strong>
</Typography>
<Typography>{article.body}</Typography>
<Button variant="outlined" color="error" onClick={() => deleteArticle(article.id)} sx={{mt: 2}}>
Unlink Article
Отвязать статью
</Button>
</Stack>
</Box>
))
) : (
<Typography>No articles linked</Typography>
<Typography>Статьи не найдены</Typography>
)}
</Grid>
<Stack gap={2}>
<Typography variant="body1" fontWeight="bold">
Link Article
Привязать статью
</Typography>
<Stack gap={2.5}>
<FormControl fullWidth>
<InputLabel>Article</InputLabel>
<Select value={selectedArticleId} onChange={(e) => setSelectedArticleId(Number(e.target.value))} label="Article" fullWidth>
<InputLabel>Статья</InputLabel>
<Select value={selectedArticleId} onChange={(e) => setSelectedArticleId(Number(e.target.value))} label="Статья" fullWidth>
{availableArticles.map((article) => (
<MenuItem key={article.id} value={article.id}>
{article.heading}
@ -167,11 +162,11 @@ export const SightShow = () => {
</FormControl>
<FormControl fullWidth>
<TextField type="number" label="Page Number" name="page_num" value={pageNum} onChange={(e) => setPageNum(Number(e.target.value))} fullWidth InputLabelProps={{shrink: true}} />
<TextField type="number" label="Номер страницы" name="page_num" value={pageNum} onChange={(e) => setPageNum(Number(e.target.value))} fullWidth InputLabelProps={{shrink: true}} />
</FormControl>
<Button variant="contained" onClick={linkArticle} disabled={!selectedArticleId}>
Link Article
Привязать
</Button>
</Stack>
</Stack>