Add localization support (#333)

* Add updated i18n config and en locale
This commit is contained in:
Jeff 2023-10-30 19:22:45 -07:00 committed by GitHub
parent 11863fd4c1
commit 8430b1ec95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 2679 additions and 908 deletions

View file

@ -4,6 +4,7 @@ import { Accordion, Button, ContextModalVars, Switch } from '/@/renderer/compone
import { useLocalStorage } from '@mantine/hooks';
import { openContextModal } from '@mantine/modals';
import isElectron from 'is-electron';
import { useTranslation } from 'react-i18next';
import { RiAddFill, RiServerFill } from 'react-icons/ri';
import { AddServerForm } from '/@/renderer/features/servers/components/add-server-form';
import { ServerListItem } from '/@/renderer/features/servers/components/server-list-item';
@ -13,6 +14,7 @@ import { titleCase } from '/@/renderer/utils';
const localSettings = isElectron() ? window.electron.localSettings : null;
export const ServerList = () => {
const { t } = useTranslation();
const serverListQuery = useServerList();
const handleAddServerModal = () => {
@ -24,7 +26,7 @@ export const ServerList = () => {
),
},
modal: 'base',
title: 'Add server',
title: t('form.addServer.title', { postProcess: 'titleCase' }),
});
};
@ -74,7 +76,7 @@ export const ServerList = () => {
variant="filled"
onClick={handleAddServerModal}
>
Add server
{t('form.addServer.title', { postProcess: 'titleCase' })}
</Button>
</Group>
<Stack>
@ -104,14 +106,18 @@ export const ServerList = () => {
<Group>
<Switch
checked={ignoreCORS === 'true'}
label="Ignore CORS (requires restart)"
label={t('form.addServer.ignoreCors', {
postProcess: 'sentenceCase',
})}
onChange={handleUpdateIgnoreCORS}
/>
</Group>
<Group>
<Switch
checked={ignoreSSL === 'true'}
label="Ignore SSL (requires restart)"
label={t('form.addServer.ignoreSsl', {
postProcess: 'sentenceCase',
})}
onChange={handleUpdateIgnoreSSL}
/>
</Group>