mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 15:05:48 +01:00
🏷️ Apply namespace types to translations
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { Button, Group, Stack, Text } from '@mantine/core';
|
import { Button, Group, Stack, Text } from '@mantine/core';
|
||||||
import { ContextModalProps } from '@mantine/modals';
|
import { ContextModalProps } from '@mantine/modals';
|
||||||
import { Trans, useTranslation } from 'next-i18next';
|
import { Trans, useTranslation } from 'next-i18next';
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { useConfigContext } from '../../../../config/provider';
|
import { useConfigContext } from '../../../../config/provider';
|
||||||
import { useConfigStore } from '../../../../config/store';
|
import { useConfigStore } from '../../../../config/store';
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const SettingsComponent = ({
|
|||||||
country: language.country,
|
country: language.country,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const { t } = useTranslation('user/preferences');
|
const { t } = useTranslation(['user/preferences', 'common']);
|
||||||
|
|
||||||
const { i18nZodResolver } = useI18nZodResolver();
|
const { i18nZodResolver } = useI18nZodResolver();
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,12 @@ import { useTranslation } from 'next-i18next';
|
|||||||
import { DashDotCompactNetwork, DashDotInfo } from './DashDotCompactNetwork';
|
import { DashDotCompactNetwork, DashDotInfo } from './DashDotCompactNetwork';
|
||||||
import { DashDotCompactStorage } from './DashDotCompactStorage';
|
import { DashDotCompactStorage } from './DashDotCompactStorage';
|
||||||
|
|
||||||
|
import { CustomTypeOptions } from 'i18next';
|
||||||
|
|
||||||
|
type GraphType = keyof CustomTypeOptions['resources']['modules/dashdot']['card']['graphs'];
|
||||||
|
|
||||||
interface DashDotGraphProps {
|
interface DashDotGraphProps {
|
||||||
graph: string;
|
graph: GraphType;
|
||||||
graphHeight: number;
|
graphHeight: number;
|
||||||
isCompact: boolean;
|
isCompact: boolean;
|
||||||
multiView: boolean;
|
multiView: boolean;
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import {
|
|||||||
IconSun,
|
IconSun,
|
||||||
} from '@tabler/icons-react';
|
} from '@tabler/icons-react';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
|
import { TranslationNamespace } from '~/i18n';
|
||||||
|
import { CustomTypeOptions } from 'i18next';
|
||||||
|
|
||||||
interface WeatherIconProps {
|
interface WeatherIconProps {
|
||||||
code: number;
|
code: number;
|
||||||
@@ -36,7 +38,9 @@ export const WeatherIcon = ({ code }: WeatherIconProps) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
type WeatherDefinitionType = { icon: Icon; name: string; codes: number[] };
|
|
||||||
|
type WeatherDescription = keyof CustomTypeOptions['resources']['modules/weather']['card']['weatherDescriptions'];
|
||||||
|
type WeatherDefinitionType = { icon: Icon; name: WeatherDescription; codes: number[] };
|
||||||
|
|
||||||
// 0 Clear sky
|
// 0 Clear sky
|
||||||
// 1, 2, 3 Mainly clear, partly cloudy, and overcast
|
// 1, 2, 3 Mainly clear, partly cloudy, and overcast
|
||||||
|
|||||||
Reference in New Issue
Block a user