mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 16:05:47 +01:00
✨ add translation for total downloads module
This commit is contained in:
@@ -13,6 +13,14 @@
|
|||||||
"nothingFound": "Keine Torrents gefunden"
|
"nothingFound": "Keine Torrents gefunden"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"lineChart": {
|
||||||
|
"title": "Derzeitige Download Geschwindigkeit",
|
||||||
|
"download": "Download: {{download}}",
|
||||||
|
"upload": "Upload: {{upload}}",
|
||||||
|
"timeSpan": "{{seconds}} Sekunden zuvor",
|
||||||
|
"totalDownload": "Download: {{download}}/s",
|
||||||
|
"totalUpload": "Upload: {{upload}}/s"
|
||||||
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"noDownloadClients": {
|
"noDownloadClients": {
|
||||||
"title": "Keine unterstützten Download Clients gefunden",
|
"title": "Keine unterstützten Download Clients gefunden",
|
||||||
|
|||||||
@@ -13,6 +13,14 @@
|
|||||||
"nothingFound": "No torrents found"
|
"nothingFound": "No torrents found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"lineChart": {
|
||||||
|
"title": "Current download speed",
|
||||||
|
"download": "Download: {{download}}",
|
||||||
|
"upload": "Upload: {{upload}}",
|
||||||
|
"timeSpan": "{{seconds}} seconds ago",
|
||||||
|
"totalDownload": "Download: {{download}}/s",
|
||||||
|
"totalUpload": "Upload: {{upload}}/s"
|
||||||
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"noDownloadClients": {
|
"noDownloadClients": {
|
||||||
"title": "No supported download clients found!",
|
"title": "No supported download clients found!",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { NormalizedTorrent } from '@ctrl/shared-torrent';
|
import { NormalizedTorrent } from '@ctrl/shared-torrent';
|
||||||
import { linearGradientDef } from '@nivo/core';
|
import { linearGradientDef } from '@nivo/core';
|
||||||
|
import { useTranslation } from 'next-i18next';
|
||||||
import { Datum, ResponsiveLine } from '@nivo/line';
|
import { Datum, ResponsiveLine } from '@nivo/line';
|
||||||
import { useListState } from '@mantine/hooks';
|
import { useListState } from '@mantine/hooks';
|
||||||
import { showNotification } from '@mantine/notifications';
|
import { showNotification } from '@mantine/notifications';
|
||||||
@@ -12,7 +13,6 @@ import { useConfig } from '../../tools/state';
|
|||||||
import { humanFileSize } from '../../tools/humanFileSize';
|
import { humanFileSize } from '../../tools/humanFileSize';
|
||||||
import { IModule } from '../ModuleTypes';
|
import { IModule } from '../ModuleTypes';
|
||||||
import { useSetSafeInterval } from '../../tools/hooks/useSetSafeInterval';
|
import { useSetSafeInterval } from '../../tools/hooks/useSetSafeInterval';
|
||||||
import { useTranslation } from 'next-i18next';
|
|
||||||
|
|
||||||
export const TotalDownloadsModule: IModule = {
|
export const TotalDownloadsModule: IModule = {
|
||||||
title: 'Download Speed',
|
title: 'Download Speed',
|
||||||
@@ -109,15 +109,19 @@ export default function TotalDownloadsComponent() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Title order={4}>Current download speed</Title>
|
<Title order={4}>{t('card.lineChart.title')}</Title>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Group>
|
<Group>
|
||||||
<ColorSwatch size={12} color={theme.colors.green[5]} />
|
<ColorSwatch size={12} color={theme.colors.green[5]} />
|
||||||
<Text>Download: {humanFileSize(totalDownloadSpeed)}/s</Text>
|
<Text>
|
||||||
|
{t('card.lineChart.totalDownload', { download: humanFileSize(totalDownloadSpeed) })}
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<ColorSwatch size={12} color={theme.colors.blue[5]} />
|
<ColorSwatch size={12} color={theme.colors.blue[5]} />
|
||||||
<Text>Upload: {humanFileSize(totalUploadSpeed)}/s</Text>
|
<Text>
|
||||||
|
{t('card.lineChart.totalUpload', { upload: humanFileSize(totalUploadSpeed) })}
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Box
|
<Box
|
||||||
@@ -138,16 +142,20 @@ export default function TotalDownloadsComponent() {
|
|||||||
const roundedSeconds = Math.round(seconds);
|
const roundedSeconds = Math.round(seconds);
|
||||||
return (
|
return (
|
||||||
<Card p="sm" radius="md" withBorder>
|
<Card p="sm" radius="md" withBorder>
|
||||||
<Text size="md">{roundedSeconds} seconds ago</Text>
|
<Text size="md">{t('card.lineChart.timeSpan', { seconds: roundedSeconds })}</Text>
|
||||||
<Card.Section p="sm">
|
<Card.Section p="sm">
|
||||||
<Stack>
|
<Stack>
|
||||||
<Group>
|
<Group>
|
||||||
<ColorSwatch size={10} color={theme.colors.green[5]} />
|
<ColorSwatch size={10} color={theme.colors.green[5]} />
|
||||||
<Text size="md">Download: {humanFileSize(Download)}</Text>
|
<Text size="md">
|
||||||
|
{t('card.lineChart.download', { download: humanFileSize(Download) })}
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<ColorSwatch size={10} color={theme.colors.blue[5]} />
|
<ColorSwatch size={10} color={theme.colors.blue[5]} />
|
||||||
<Text size="md">Upload: {humanFileSize(Upload)}</Text>
|
<Text size="md">
|
||||||
|
{t('card.lineChart.upload', { upload: humanFileSize(Upload) })}
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Card.Section>
|
</Card.Section>
|
||||||
|
|||||||
Reference in New Issue
Block a user