diff --git a/web/src/components/Add/AddDialog.jsx b/web/src/components/Add/AddDialog.jsx
index 6d042fb..174ec2d 100644
--- a/web/src/components/Add/AddDialog.jsx
+++ b/web/src/components/Add/AddDialog.jsx
@@ -7,6 +7,7 @@ import DialogContent from '@material-ui/core/DialogContent'
import DialogTitle from '@material-ui/core/DialogTitle'
import { torrentsHost } from 'utils/Hosts'
import axios from 'axios'
+import { useTranslation } from 'react-i18next'
export default function AddDialog({ handleClose }) {
const [link, setLink] = useState('')
@@ -17,23 +18,26 @@ export default function AddDialog({ handleClose }) {
const inputTitle = ({ target: { value } }) => setTitle(value)
const inputPoster = ({ target: { value } }) => setPoster(value)
+ // eslint-disable-next-line no-unused-vars
+ const { t } = useTranslation()
+
const handleSave = () => {
axios.post(torrentsHost(), { action: 'add', link, title, poster, save_to_db: true }).finally(() => handleClose())
}
return (
diff --git a/web/src/components/DialogTorrentDetailsContent/DialogHeader.jsx b/web/src/components/DialogTorrentDetailsContent/DialogHeader.jsx
index 520ed60..e79569a 100644
--- a/web/src/components/DialogTorrentDetailsContent/DialogHeader.jsx
+++ b/web/src/components/DialogTorrentDetailsContent/DialogHeader.jsx
@@ -2,6 +2,7 @@ import Button from '@material-ui/core/Button'
import { AppBar, IconButton, makeStyles, Toolbar, Typography } from '@material-ui/core'
import CloseIcon from '@material-ui/icons/Close'
import { ArrowBack } from '@material-ui/icons'
+import { useTranslation } from 'react-i18next'
const useStyles = makeStyles(theme => ({
appBar: { position: 'relative' },
@@ -10,6 +11,8 @@ const useStyles = makeStyles(theme => ({
export default function DialogHeader({ title, onClose, onBack }) {
const classes = useStyles()
+ // eslint-disable-next-line no-unused-vars
+ const { t } = useTranslation()
return (
@@ -24,7 +27,7 @@ export default function DialogHeader({ title, onClose, onBack }) {
{onBack && (
)}
diff --git a/web/src/components/TorrentList.jsx b/web/src/components/TorrentList.jsx
index c75c9d2..0639375 100644
--- a/web/src/components/TorrentList.jsx
+++ b/web/src/components/TorrentList.jsx
@@ -5,12 +5,15 @@ import TorrentCard from 'components/TorrentCard'
import axios from 'axios'
import CircularProgress from '@material-ui/core/CircularProgress'
import { TorrentListWrapper, CenteredGrid } from 'App/style'
+import { useTranslation } from 'react-i18next'
export default function TorrentList() {
const [torrents, setTorrents] = useState([])
const [isLoading, setIsLoading] = useState(true)
const [isOffline, setIsOffline] = useState(true)
const timerID = useRef(-1)
+ // eslint-disable-next-line no-unused-vars
+ const { t } = useTranslation()
useEffect(() => {
timerID.current = setInterval(() => {
@@ -39,9 +42,9 @@ export default function TorrentList() {
{isLoading ? (
) : isOffline ? (
- Offline
+ {t('Offline')}
) : (
- !torrents.length && No torrents added
+ !torrents.length && {t('NoTorrentsAdded')}
)}
)
diff --git a/web/src/locales/en/translation.json b/web/src/locales/en/translation.json
index 594a538..fe7e4c1 100644
--- a/web/src/locales/en/translation.json
+++ b/web/src/locales/en/translation.json
@@ -1,6 +1,8 @@
{
"About": "About",
+ "Add": "Add",
"AddFromLink": "Add from Link",
+ "AddMagnetOrLink": "Add magnet or link to torrent file",
"AddRetrackers": "Add retrackers",
"Buffer": "Buffer",
"CacheSize": "Cache Size (Megabytes)",
@@ -30,12 +32,16 @@
"Host": "Host",
"Info": "Info",
"LatestFilePlayed": "Latest file played:",
+ "MagnetOrTorrentFileLink": "Magnet or torrent file link",
"Name": "Name",
+ "NoTorrentsAdded": "No torrents added",
+ "Offline": "Offline",
"OK": "OK",
"Peers": "Peers",
"PeersListenPort": "Peers Listen Port",
"PEX": "PEX (Peer Exchange)",
"PlaylistAll": "Playlist All",
+ "Poster": "Poster",
"PreloadBuffer": "Preload Buffer",
"ReaderReadAHead": "Reader Read Ahead (5-100%)",
"RemoveAll": "Remove All",
@@ -54,6 +60,7 @@
"Speed": "Speed",
"TCP": "TCP (Transmission Control Protocol)",
"ThanksToEveryone": "Thanks to everyone who tested and helped.",
+ "Title": "Title",
"TorrentContent": "Torrent Content",
"TorrentDetails": "Torrent Details",
"TorrentDisconnectTimeout": "Torrent Disconnect Timeout",
diff --git a/web/src/locales/ru/translation.json b/web/src/locales/ru/translation.json
index 9509739..d0c8d36 100644
--- a/web/src/locales/ru/translation.json
+++ b/web/src/locales/ru/translation.json
@@ -1,6 +1,8 @@
{
"About": "О сервере",
+ "Add": "Добавить",
"AddFromLink": "Добавить",
+ "AddMagnetOrLink": "Добавьте magnet или ссылку на торрент",
"AddRetrackers": "Добавлять",
"Buffer": "Буфер",
"CacheSize": "Размер кеша (Мегабайты)",
@@ -30,12 +32,16 @@
"Host": "Хост",
"Info": "Инфо",
"LatestFilePlayed": "Последний воспроизведенный файл:",
+ "MagnetOrTorrentFileLink": "Ссылка на файл торрента или magnet-ссылка",
"Name": "Имя",
+ "NoTorrentsAdded": "Нет торрентов",
+ "Offline": "Сервер не доступен",
"OK": "OK",
"Peers": "Подкл./Пиры",
"PeersListenPort": "Порт для входящих подключений",
"PEX": "PEX (Peer Exchange)",
"PlaylistAll": "Плейлист всех",
+ "Poster": "Постер",
"PreloadBuffer": "Наполнять кеш перед началом воспроизведения",
"ReaderReadAHead": "Кеш предзагрузки (5-100%, рек. 95%)",
"RemoveAll": "Удалить все",
@@ -54,11 +60,12 @@
"Speed": "Скорость",
"TCP": "TCP (Transmission Control Protocol)",
"ThanksToEveryone": "Спасибо всем, кто тестировал и помогал!",
+ "Title": "Название",
"TorrentContent": "Содержимое торрента",
"TorrentDetails": "Информация о торренте",
"TorrentDisconnectTimeout": "Тайм-аут отключения торрента (секунды)",
"TorrentsSavePath": "Путь хранения кеша",
- "TorrentState": "Состояние",
+ "TorrentState": "Данные торрента",
"Upload": "Отдача (не рекомендуется отключать)",
"UploadFile": "Загрузить файл",
"UploadRateLimit": "Ограничение скорости отдачи (Килобайты)",