Skip to content

Commit 9b5986b

Browse files
committed
Restructure translations
1 parent 01770d1 commit 9b5986b

File tree

30 files changed

+176
-129
lines changed

30 files changed

+176
-129
lines changed

src/entities/connection/ui/ConnectionTypeForm/components/ConnectionAuthBasic/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ export const ConnectionAuthBasic = () => {
1111
return (
1212
<>
1313
{/* Hide Form.Item control, because its value is set in 'useSelectConnectionType' hook */}
14-
<Form.Item name={['auth_data', 'type']} hidden>
15-
<Input size="large" />
16-
</Form.Item>
17-
<Form.Item label={t('user', { ns: 'group' })} name={['auth_data', 'user']} rules={[{ required: true }]}>
14+
<Form.Item name={['auth_data', 'type']} hidden/>
15+
<Form.Item label={t('username')} name={['auth_data', 'user']} rules={[{ required: true }]}>
1816
<Input size="large" />
1917
</Form.Item>
2018
<Form.Item label={t('password')} name={['auth_data', 'password']} rules={[{ required: isRequired }]}>

src/entities/connection/ui/ConnectionTypeForm/components/ConnectionAuthS3/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ import { useTranslation } from 'react-i18next';
55
import { useSensitiveFields } from '../../hooks';
66

77
export const ConnectionAuthS3 = () => {
8-
const { t } = useTranslation('connection');
8+
const { t } = useTranslation('connection', { keyPrefix: 's3' });
99
const { isRequired } = useSensitiveFields();
1010

1111
return (
1212
<>
1313
{/* Hide Form.Item control, because its value is set in 'useSelectConnectionType' hook */}
14-
<Form.Item name={['auth_data', 'type']} hidden>
15-
<Input size="large" />
16-
</Form.Item>
14+
<Form.Item name={['auth_data', 'type']} hidden/>
1715
<Form.Item label={t('accessKey')} name={['auth_data', 'access_key']} rules={[{ required: true }]}>
1816
<Input size="large" />
1917
</Form.Item>

src/entities/connection/ui/ConnectionTypeForm/components/ConnectionAuthSamba/index.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ export const ConnectionAuthSamba = () => {
1414
return (
1515
<>
1616
{/* Hide Form.Item control, because its value is set in 'useSelectConnectionType' hook */}
17-
<Form.Item name={['auth_data', 'type']} hidden>
18-
<Input size="large" />
19-
</Form.Item>
20-
<Form.Item label={t('user', { ns: 'group' })} name={['auth_data', 'user']} rules={[{ required: true }]}>
17+
<Form.Item name={['auth_data', 'type']} hidden/>
18+
<Form.Item
19+
label={t('username', { ns: 'auth' })}
20+
name={['auth_data', 'user']}
21+
rules={[{ required: true }]}
22+
>
2123
<Input size="large" />
2224
</Form.Item>
2325
<Form.Item
@@ -27,8 +29,11 @@ export const ConnectionAuthSamba = () => {
2729
>
2830
<Input.Password size="large" />
2931
</Form.Item>
30-
<Form.Item name={['auth_data', 'auth_type']}>
31-
<Select size="large" options={CONNECTION_SAMBA_AUTH_TYPE_SELECT_OPTIONS} placeholder={t('selectProtocol')} />
32+
<Form.Item
33+
label={t('samba.authType')}
34+
name={['auth_data', 'auth_type']}
35+
>
36+
<Select size="large" options={CONNECTION_SAMBA_AUTH_TYPE_SELECT_OPTIONS} placeholder={t('samba.selectAuthType')} />
3237
</Form.Item>
3338
</>
3439
);

src/entities/connection/ui/ConnectionTypeForm/components/ConnectionOracle/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,24 @@ export const ConnectionOracle = () => {
4141
<InputNumber size="large" min={MIN_ALLOWED_PORT} max={MAX_ALLOWED_PORT} />
4242
</Form.Item>
4343
<Form.Item
44-
label={t('serviceName')}
44+
label={t('oracle.serviceName')}
4545
name={['connection_data', 'service_name']}
4646
rules={[
4747
{
4848
required: !isServiceNameDisabled,
49-
message: t('serviceNameOrSidRequired'),
49+
message: t('oracle.serviceNameOrSidRequired'),
5050
},
5151
]}
5252
>
5353
<Input size="large" disabled={isServiceNameDisabled} onChange={handleFieldChange} />
5454
</Form.Item>
5555
<Form.Item
56-
label={t('sid')}
56+
label={t('oracle.sid')}
5757
name={['connection_data', 'sid']}
5858
rules={[
5959
{
6060
required: !isSidDisabled,
61-
message: t('serviceNameOrSidRequired'),
61+
message: t('oracle.serviceNameOrSidRequired'),
6262
},
6363
]}
6464
>

src/entities/connection/ui/ConnectionTypeForm/components/ConnectionS3/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ export const ConnectionS3 = () => {
1818
<Form.Item label={t('protocol')} name={['connection_data', 'protocol']}>
1919
<Select size="large" options={CONNECTION_PROTOCOL_SELECT_OPTIONS} placeholder={t('selectProtocol')} />
2020
</Form.Item>
21-
<Form.Item label={t('bucketStyle')} name={['connection_data', 'bucket_style']}>
22-
<Select size="large" options={CONNECTION_BUCKET_STYLE_SELECT_OPTIONS} placeholder={t('selectBucketStyle')} />
21+
<Form.Item label={t('s3.bucketStyle')} name={['connection_data', 'bucket_style']}>
22+
<Select size="large" options={CONNECTION_BUCKET_STYLE_SELECT_OPTIONS} placeholder={t('s3.selectBucketStyle')} />
2323
</Form.Item>
24-
<Form.Item label={t('bucket')} name={['connection_data', 'bucket']} rules={[{ required: true }]}>
24+
<Form.Item label={t('s3.bucket')} name={['connection_data', 'bucket']} rules={[{ required: true }]}>
2525
<Input size="large" />
2626
</Form.Item>
2727
<Form.Item label={t('port')} name={['connection_data', 'port']}>
2828
<InputNumber size="large" min={MIN_ALLOWED_PORT} max={MAX_ALLOWED_PORT} />
2929
</Form.Item>
30-
<Form.Item label={t('region')} name={['connection_data', 'region']}>
30+
<Form.Item label={t('s3.region')} name={['connection_data', 'region']}>
3131
<Input size="large" />
3232
</Form.Item>
3333
<ConnectionAuthS3 />

src/entities/connection/ui/ConnectionTypeForm/components/ConnectionSamba/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Select } from '@shared/ui';
44
import { useTranslation } from 'react-i18next';
55

66
import { MAX_ALLOWED_PORT, MIN_ALLOWED_PORT } from '../../constants';
7-
import { ConnectionAuthBasic } from '../ConnectionAuthBasic';
7+
import { ConnectionAuthSamba } from '../ConnectionAuthSamba';
88

99
import { CONNECTION_SAMBA_PROTOCOL_SELECT_OPTIONS } from './constants';
1010

@@ -16,7 +16,7 @@ export const ConnectionSamba = () => {
1616
<Form.Item label={t('host')} name={['connection_data', 'host']} rules={[{ required: true }]}>
1717
<Input size="large" />
1818
</Form.Item>
19-
<Form.Item label={t('share')} name={['connection_data', 'share']} rules={[{ required: true }]}>
19+
<Form.Item label={t('samba.share')} name={['connection_data', 'share']} rules={[{ required: true }]}>
2020
<Input size="large" />
2121
</Form.Item>
2222
<Form.Item label={t('protocol')} name={['connection_data', 'protocol']}>
@@ -25,10 +25,10 @@ export const ConnectionSamba = () => {
2525
<Form.Item label={t('port')} name={['connection_data', 'port']}>
2626
<InputNumber size="large" min={MIN_ALLOWED_PORT} max={MAX_ALLOWED_PORT} />
2727
</Form.Item>
28-
<Form.Item label={t('domain')} name={['connection_data', 'domain']}>
28+
<Form.Item label={t('samba.domain')} name={['connection_data', 'domain']}>
2929
<Input size="large" />
3030
</Form.Item>
31-
<ConnectionAuthBasic />
31+
<ConnectionAuthSamba />
3232
</>
3333
);
3434
};

src/entities/file/ui/FileFormatParams/components/FileFormatCsv/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export const FileFormatCsv = ({ name }: FileFormatCsvProps) => {
2626
</Form.Item>
2727
<Form.Item label={t('includeHeader')} name={[...name, 'include_header']}>
2828
<Radio.Group>
29-
<Radio value={true}>{t('yes')}</Radio>
30-
<Radio value={false}>{t('no')}</Radio>
29+
<Radio value={true}>{t('yes', { ns: 'shared' })}</Radio>
30+
<Radio value={false}>{t('no', { ns: 'shared' })}</Radio>
3131
</Radio.Group>
3232
</Form.Item>
3333
<Form.Item label={t('lineSeparator')} name={[...name, 'line_sep']}>

src/entities/file/ui/FileFormatParams/components/FileFormatExcel/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export const FileFormatExcel = ({ name }: FileFormatExcelProps) => {
1111
<>
1212
<Form.Item label={t('includeHeader')} name={[...name, 'include_header']}>
1313
<Radio.Group>
14-
<Radio value={true}>{t('yes')}</Radio>
15-
<Radio value={false}>{t('no')}</Radio>
14+
<Radio value={true}>{t('yes', { ns: 'shared' })}</Radio>
15+
<Radio value={false}>{t('no', { ns: 'shared' })}</Radio>
1616
</Radio.Group>
1717
</Form.Item>
1818
<Form.Item label={t('startCell')} name={[...name, 'start_cell']}>

src/features/connection/ConnectionDetailInfo/utils/getConnectionAuthData/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ export const getConnectionAuthData = (connection: Connection, t: TFunction<'conn
1010
case ConnectionType.S3:
1111
return [
1212
{
13-
label: t('accessKey'),
13+
label: t('s3.accessKey'),
1414
content: auth_data.access_key,
1515
},
1616
];
1717
case ConnectionType.SAMBA:
1818
return [
1919
{
20-
label: t('user', { ns: 'group' }),
20+
label: t('username', { ns: 'auth' }),
2121
content: auth_data.user,
2222
},
2323
{
24-
label: t('authType', { ns: 'auth' }),
24+
label: t('samba.authType'),
2525
content: auth_data.auth_type,
2626
},
2727
];
@@ -38,7 +38,7 @@ export const getConnectionAuthData = (connection: Connection, t: TFunction<'conn
3838
case ConnectionType.MS_SQL:
3939
return [
4040
{
41-
label: t('user', { ns: 'group' }),
41+
label: t('username', { ns: 'auth' }),
4242
content: auth_data.user,
4343
},
4444
];

src/features/connection/ConnectionDetailInfo/utils/getConnectionData/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const getConnectionData = (connection: Connection, t: TFunction<'connecti
4242
content: connection_data.host,
4343
},
4444
{
45-
label: t('share'),
45+
label: t('samba.share'),
4646
content: connection_data.share,
4747
},
4848
{
@@ -54,14 +54,14 @@ export const getConnectionData = (connection: Connection, t: TFunction<'connecti
5454
content: connection_data.port || '',
5555
},
5656
{
57-
label: t('domain'),
57+
label: t('samba.domain'),
5858
content: connection_data.domain,
5959
},
6060
];
6161
case ConnectionType.ORACLE:
6262
return [
6363
{
64-
label: connection_data.service_name ? t('serviceName') : t('sid'),
64+
label: connection_data.service_name ? t('oracle.serviceName') : t('oracle.sid'),
6565
content: connection_data.service_name || connection_data.sid,
6666
},
6767
{
@@ -98,11 +98,11 @@ export const getConnectionData = (connection: Connection, t: TFunction<'connecti
9898
content: connection_data.host,
9999
},
100100
{
101-
label: t('bucketStyle'),
101+
label: t('s3.bucketStyle'),
102102
content: connection_data.bucket_style,
103103
},
104104
{
105-
label: t('bucket'),
105+
label: t('s3.bucket'),
106106
content: connection_data.bucket,
107107
},
108108
{
@@ -114,7 +114,7 @@ export const getConnectionData = (connection: Connection, t: TFunction<'connecti
114114
content: connection_data.port || '',
115115
},
116116
{
117-
label: t('region'),
117+
label: t('s3.region'),
118118
content: connection_data.region || '',
119119
},
120120
];

0 commit comments

Comments
 (0)