🚧 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

@@ -5,7 +5,7 @@ import { useEffect, useState } from 'react';
import { IconPlug as Plug } from '@tabler/icons';
import { useConfig } from '../../tools/state';
import { IModule } from '../ModuleTypes';
import { t } from 'i18next';
import { useTranslation } from 'next-i18next';
export const PingModule: IModule = {
title: 'Ping Services',
@@ -23,6 +23,8 @@ export default function PingComponent(props: any) {
const [response, setResponse] = useState(500);
const exists = config.modules?.[PingModule.title]?.enabled ?? false;
const { t } = useTranslation('modules/ping-module');
function statusCheck(response: AxiosResponse) {
const { status }: { status: string[] } = props;
//Default Status
@@ -69,10 +71,10 @@ export default function PingComponent(props: any) {
radius="lg"
label={
isOnline === 'loading'
? t('modules.ping.states.loading')
? t('states.loading')
: isOnline === 'online'
? t('modules.ping.states.online', { response })
: t('modules.ping.states.offline', { response })
? t('states.online', { response })
: t('states.offline', { response })
}
>
<Indicator