🚧 wip migrate to next-i18n

This commit is contained in:
Manuel Ruwe
2022-08-22 09:50:54 +02:00
parent ac4dc23e08
commit 6d0a31f79e
61 changed files with 817 additions and 753 deletions

View File

@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { createStyles, Switch, Group } from '@mantine/core';
import { useTranslation } from 'next-i18next';
import { useConfig } from '../../tools/state';
import { t } from 'i18next';
const useStyles = createStyles((theme) => ({
root: {
@@ -34,6 +34,7 @@ export function WidgetsPositionSwitch() {
const { classes, cx } = useStyles();
const defaultPosition = config?.settings?.widgetPosition || 'right';
const [widgetPosition, setWidgetPosition] = useState(defaultPosition);
const { t } = useTranslation('settings/general/widget-positions');
const toggleWidgetPosition = () => {
const position = widgetPosition === 'right' ? 'left' : 'right';
setWidgetPosition(position);
@@ -55,7 +56,7 @@ export function WidgetsPositionSwitch() {
size="md"
/>
</div>
{t('settings.tabs.common.settings.widgetsPositionSwitch.label')}
{t('label')}
</Group>
);
}