From eab290d2657178364cebe5483686303bbdac3406 Mon Sep 17 00:00:00 2001 From: lupusA Date: Sun, 10 Mar 2024 18:34:58 +0100 Subject: [PATCH] Language selection now works properly. Added some translations. --- public/locales/de-DE/translation.json | 10 +- public/locales/en-GB/translation.json | 10 +- public/locales/es-ES/translation.json | 167 ++++++++++++------------ public/locales/fr-FR/translation.json | 176 ++++++++++++------------- src/assets/languages.json | 20 +-- src/components/LanguageSelection.jsx | 13 +- src/css/App.css | 5 +- src/pages/Tasks.jsx | 177 ++++++++++++-------------- src/utils/18ns.js | 6 +- 9 files changed, 293 insertions(+), 291 deletions(-) diff --git a/public/locales/de-DE/translation.json b/public/locales/de-DE/translation.json index 5e403c4..8ab7566 100644 --- a/public/locales/de-DE/translation.json +++ b/public/locales/de-DE/translation.json @@ -9,10 +9,12 @@ "task.running":"Running", "task.failed":"Fehlgeschlagen", "task.loading": "Loading...", - "task.time.start": "Start time", - "task.status": "Status", - "task.kind": "Art", - "task.description": "Beschreibung", + "task.header.time.start": "Startzeit", + "task.header.status": "Status", + "task.header.kind": "Art", + "task.header.description": "Beschreibung", + "task.feedback.search": "Suchen nach Einträgen per Beschreibung", + "task.feedback.entries": "Hier erscheint eine Liste von Aufgaben, sobald Snapshots, Wartungsaufgaben oder Wiederherstellungen durchgeführt werden.", "task.status.succeed.after": "Task succeeded after", "task.status.canceled": "Task canceled after", diff --git a/public/locales/en-GB/translation.json b/public/locales/en-GB/translation.json index 1037b0e..8dfc655 100644 --- a/public/locales/en-GB/translation.json +++ b/public/locales/en-GB/translation.json @@ -9,10 +9,12 @@ "task.running":"Running", "task.failed":"Failed", "task.loading": "Loading...", - "task.time.start": "Start time", - "task.status": "Status", - "task.kind": "Kind", - "task.description": "Description", + "task.header.time.start": "Start time", + "task.header.status": "Status", + "task.header.kind": "Kind", + "task.header.description": "Description", + "task.feedback.search": "Search logs by description", + "task.feedback.entries": "A list of tasks will appear here when you create snapshots, restore, run maintenance, etc.", "task.status.succeed.after": "Task succeeded after", "task.status.canceled": "Task canceled after", diff --git a/public/locales/es-ES/translation.json b/public/locales/es-ES/translation.json index 1a32b1d..14e8d2a 100644 --- a/public/locales/es-ES/translation.json +++ b/public/locales/es-ES/translation.json @@ -1,89 +1,96 @@ { - "tab.preferences":"Preferencias", - "tab.repository":"Repositorio", - "tab.tasks":"Tareas", - "tab.policies":"Políticas", - "tab.snapshots":"Imágenes", - - "task.all":"All", - "task.running":"Running", - "task.failed":"Fallido", - "task.loading": "Loading...", - "task.time.start": "Start time", - "task.status": "Estado", - "task.kind": "Kind", - "task.description": "Descripción", - - "task.status.succeed.after": "Task succeeded after", - "task.status.canceled": "Task canceled after", - "task.status.canceling": "Canceling", - "task.status.error": "Task error", - "task.status.running.for": "Task running for", - - "task.status.started": "Comenzó", - "task.status.finished": "Terminado", + "tab.preferences": "Preferencias", + "tab.repository": "Repositorio", + "tab.tasks": "Tareas", + "tab.policies": "Políticas", + "tab.snapshots": "Instantáneas", + + "task.all": "Todas", + "task.running": "En ejecución", + "task.failed": "Fallidas", + "task.loading": "Cargando...", + "task.header.time.start": "Hora de inicio", + "task.header.status": "Estado", + "task.header.kind": "Tipo", + "task.header.description": "Descripción", + "task.feedback.search": "Buscar registros por descripción", + "task.feedback.entries": "Aquí aparecerá una lista de tareas cuando crees instantáneas, restaures, ejecutes mantenimiento, etc.", + + "task.status.succeed.after": "La tarea se completó con éxito después de", + "task.status.canceled": "Tarea cancelada después de", + "task.status.canceling": "Cancelando", + "task.status.error": "Error en la tarea", + "task.status.running.for": "Tarea en ejecución durante", + "task.status.started": "Iniciada", + "task.status.finished": "Finalizada", + "task.logs": "Registros", - - "task.event.stop": "Stop", - "task.header.counter": "Counter", - "task.header.value": "Value", - - "repository.status.initializing": "Initializing repository...", - "repository.status.connected": "Connected to repository", - "repository.event.connection.cancel":"Cancel connection", - "repository.event.connection.disconnect": "Disconnect from repository", + "task.event.stop": "Detener", + "task.header.counter": "Contador", + "task.header.value": "Valor", + + "snapshot.header.actions": "Acciones", + "snapshot.header.status": "Estado", + "snapshot.header.snapshot.next": "Siguiente instantánea", + "snapshot.header.snapshot.last": "Última instantánea", + "snapshot.header.snapshot.size": "Tamaño", + "snapshot.header.snapshot.owner": "Propietario", + "snapshot.header.snapshot.path": "Ruta", + "snapshot.event.snapshot.now": "Instantánea ahora", + "snapshot.event.snapshot.policy": "Política", + "snapshot.event.snapshot.pending": "Pendiente", + "snapshot.feedback.snapshot.start": "La instantánea comenzará después de que se complete la instantánea anterior", + "snapshot.event.snapshot.new": "Nueva instantánea", + "snapshot.event.sychronize": "Sincronizar", + + "repository.status.initializing": "Inicializando el repositorio...", + "repository.status.connected": "Conectado al repositorio", + "repository.event.connection.cancel": "Cancelar conexión", + "repository.event.connection.disconnect": "Desconectar del repositorio", "repository.event.description.update": "Actualizar descripción", - - "repository.feedback.description.required":"Repository description is required", - "repository.feedback.read.only": "Repository is read-only", - "repository.feedback.eco.disabled":"Discapacitados", - "repository.feedback.compression.internal.supported": "yes", + "repository.feedback.description.required": "La descripción del repositorio es obligatoria", + "repository.feedback.read.only": "El repositorio es de solo lectura", + "repository.feedback.eco.disabled": "Deshabilitado", + "repository.feedback.compression.internal.supported": "sí", "repository.feedback.compression.internal.not.supported": "no", - - "repository.attribute.server.url": "Server URL", - "repository.attribute.config.file": "Config file", + "repository.attribute.server.url": "URL del servidor", + "repository.attribute.config.file": "Archivo de configuración", "repository.attribute.provider": "Proveedor", - "repository.attribute.algorithm.encryption": "Encryption algorithm", - "repository.attribute.algorithm.hash": "Hash algorithm", - "repository.attribute.algorithm.splitter": "Splitter algorithm", - "repository.attribute.algorithm.eco": "Error correction algorithm", - + "repository.attribute.algorithm.encryption": "Algoritmo de cifrado", + "repository.attribute.algorithm.hash": "Algoritmo de hash", + "repository.attribute.algorithm.splitter": "Algoritmo de división", + "repository.attribute.algorithm.eco": "Algoritmo de corrección de errores", "repository.attribute.connected.as": "Conectado como", - "repository.attribute.compression.internal": "Internal compression", - "repository.attribute.format": "Repository format", - "repository.attribute.eco": "Error correction overhead", - - "log.event.hide": "Hide log", - "log.event.show": "Show log", - - "user.interface": "User interface", - "user.interface.appearance":"Apariencia", - "user.interface.appearance.hint":"Select font size", - "user.interface.appearance.help": "Specifies the appearance of the user interface", - - "user.interface.appearance.small":"pequeño", - "user.interface.appearance.medium":"medio", - "user.interface.appearance.large":"grande", - - "user.interface.pagesize.description": "Page size", - "user.interface.pagesize.help": "Specifies the pagination size in tables", + "repository.attribute.compression.internal": "Compresión interna", + "repository.attribute.format": "Formato del repositorio", + "repository.attribute.eco": "Overhead de corrección de errores", + + "log.event.hide": "Ocultar registro", + "log.event.show": "Mostrar registro", + + "user.interface": "Interfaz de usuario", + "user.interface.appearance": "Apariencia", + "user.interface.appearance.hint": "Selecciona el tamaño de fuente", + "user.interface.appearance.help": "Especifica la apariencia de la interfaz de usuario", + "user.interface.appearance.small": "pequeño", + "user.interface.appearance.medium": "mediano", + "user.interface.appearance.large": "grande", + "user.interface.pagesize.description": "Tamaño de página", + "user.interface.pagesize.help": "Especifica el tamaño de paginación en las tablas", "user.interface.pagesize.hint": "Tamaño de página", - - "user.interface.byte.representation.description":"Select byte representation", - "user.interface.byte.representation.select":"Select byte representation", - "user.interface.byte.representation.help":"Specifies the representation of bytes", - - "user.language":"Language", - - "lang.help": "Sets the language for the user interface", - "lang.select": "Select language", - "lang.description": "Select the language", - - "theme.description": "Theme", - "theme.select": "Select theme", - "theme.help": "The current active theme", - "theme.dark":"dark", - "theme.light": "light", + "user.interface.byte.representation.description": "Selecciona la representación de bytes", + "user.interface.byte.representation.select": "Selecciona la representación de bytes", + "user.interface.byte.representation.help": "Especifica la representación de bytes", + "user.language": "Idioma", + + "lang.help": "Establece el idioma para la interfaz de usuario", + "lang.select": "Selecciona el idioma", + "lang.description": "Selecciona el idioma", + "theme.description": "Tema", + "theme.select": "Seleccionar tema", + "theme.help": "El tema activo actual", + "theme.dark": "oscuro", + "theme.light": "claro", "theme.pastel": "pastel", - "theme.ocean":"ocean" + "theme.ocean": "oceánico" } \ No newline at end of file diff --git a/public/locales/fr-FR/translation.json b/public/locales/fr-FR/translation.json index eea2936..657b490 100644 --- a/public/locales/fr-FR/translation.json +++ b/public/locales/fr-FR/translation.json @@ -1,89 +1,93 @@ { - "tab.preferences":"Preferences", - "tab.repository":"Repository", - "tab.tasks":"Tasks", - "tab.policies":"Policies", - "tab.snapshots":"Snapshots", - - "task.all":"All", - "task.running":"Running", - "task.failed":"Failed", - "task.loading": "Loading...", - "task.time.start": "Start time", - "task.status": "Status", - "task.kind": "Kind", - "task.description": "Description", - - "task.status.succeed.after": "Task succeeded after", - "task.status.canceled": "Task canceled after", - "task.status.canceling": "Canceling", - "task.status.error": "Task error", - "task.status.running.for": "Task running for", - - "task.status.started": "Started", - "task.status.finished": "Finished", - "task.logs": "Logs", - - "task.event.stop": "Stop", - "task.header.counter": "Counter", - "task.header.value": "Value", - - "repository.status.initializing": "Initializing repository...", - "repository.status.connected": "Connected to repository", - "repository.event.connection.cancel":"Cancel connection", - "repository.event.connection.disconnect": "Disconnect from repository", - "repository.event.description.update": "Update description", - - "repository.feedback.description.required":"Repository description is required", - "repository.feedback.read.only": "Repository is read-only", - "repository.feedback.eco.disabled":"Disabled", - "repository.feedback.compression.internal.supported": "yes", - "repository.feedback.compression.internal.not.supported": "no", - - "repository.attribute.server.url": "Server URL", - "repository.attribute.config.file": "Config file", - "repository.attribute.provider": "Provider", - "repository.attribute.algorithm.encryption": "Encryption algorithm", - "repository.attribute.algorithm.hash": "Hash algorithm", - "repository.attribute.algorithm.splitter": "Splitter algorithm", - "repository.attribute.algorithm.eco": "Error correction algorithm", - - "repository.attribute.connected.as": "Connected as", - "repository.attribute.compression.internal": "Internal compression", - "repository.attribute.format": "Repository format", - "repository.attribute.eco": "Error correction overhead", - - "log.event.hide": "Hide log", - "log.event.show": "Show log", - - "user.interface": "User interface", - "user.interface.appearance":"Appearance", - "user.interface.appearance.hint":"Select font size", - "user.interface.appearance.help": "Specifies the appearance of the user interface", - - "user.interface.appearance.small":"small", - "user.interface.appearance.medium":"medium", - "user.interface.appearance.large":"large", - - "user.interface.pagesize.description": "Page size", - "user.interface.pagesize.help": "Specifies the pagination size in tables", - "user.interface.pagesize.hint": "Page size", - - "user.interface.byte.representation.description":"Select byte representation", - "user.interface.byte.representation.select":"Select byte representation", - "user.interface.byte.representation.help":"Specifies the representation of bytes", - - "user.language":"Language", - - "lang.help": "Sets the language for the user interface", - "lang.select": "Select language", - "lang.description": "Select the language", - - "theme.description": "Theme", - "theme.select": "Select theme", - "theme.help": "The current active theme", - "theme.dark":"dark", - "theme.light": "light", + "tab.preferences": "Préférences", + "tab.repository": "Répertoire", + "tab.tasks": "Tâches", + "tab.policies": "Politiques", + "tab.snapshots": "Instantanés", + + "task.all": "Tous", + "task.running": "En cours", + "task.failed": "Échoué", + "task.loading": "Chargement...", + "task.header.time.start": "Heure de début", + "task.header.status": "Statut", + "task.header.kind": "Type", + "task.header.description": "Description", + "task.feedback.search": "Rechercher des journaux par description", + "task.feedback.entries": "Une liste de tâches apparaîtra ici lorsque vous créerez des instantanés, restaurerez, exécuterez des opérations de maintenance, etc.", + "task.status.succeed.after": "Tâche réussie après", + "task.status.canceled": "Tâche annulée après", + "task.status.canceling": "Annulation en cours", + "task.status.error": "Erreur de tâche", + "task.status.running.for": "Tâche en cours depuis", + "task.status.started": "Démarré", + "task.status.finished": "Terminé", + "task.logs": "Journaux", + "task.event.stop": "Arrêter", + "task.header.counter": "Compteur", + "task.header.value": "Valeur", + + "snapshot.header.actions": "Actions", + "snapshot.header.status": "Statut", + "snapshot.header.snapshot.next": "Instantané suivant", + "snapshot.header.snapshot.last": "Dernier instantané", + "snapshot.header.snapshot.size": "Taille", + "snapshot.header.snapshot.owner": "Propriétaire", + "snapshot.header.snapshot.path": "Chemin", + "snapshot.event.snapshot.now": "Instantané maintenant", + "snapshot.event.snapshot.policy": "Politique", + "snapshot.event.snapshot.pending": "En attente", + "snapshot.feedback.snapshot.start": "L'instantané démarrera après la fin de l'instantané précédent", + "snapshot.event.snapshot.new": "Nouvel instantané", + "snapshot.event.synchronize": "Synchroniser", + + "repository.status.initializing": "Initialisation du répertoire...", + "repository.status.connected": "Connecté au répertoire", + "repository.event.connection.cancel": "Annuler la connexion", + "repository.event.connection.disconnect": "Déconnexion du répertoire", + "repository.event.description.update": "Mettre à jour la description", + "repository.feedback.description.required": "La description du répertoire est obligatoire", + "repository.feedback.read.only": "Le répertoire est en lecture seule", + "repository.feedback.eco.disabled": "Désactivé", + "repository.feedback.compression.internal.supported": "oui", + "repository.feedback.compression.internal.not.supported": "non", + "repository.attribute.server.url": "URL du serveur", + "repository.attribute.config.file": "Fichier de configuration", + "repository.attribute.provider": "Fournisseur", + "repository.attribute.algorithm.encryption": "Algorithme de chiffrement", + "repository.attribute.algorithm.hash": "Algorithme de hachage", + "repository.attribute.algorithm.splitter": "Algorithme de découpage", + "repository.attribute.algorithm.eco": "Algorithme de correction d'erreurs", + "repository.attribute.connected.as": "Connecté en tant que", + "repository.attribute.compression.internal": "Compression interne", + "repository.attribute.format": "Format du répertoire", + "repository.attribute.eco": "Surcoût de correction d'erreurs", + + "log.event.hide": "Masquer le journal", + "log.event.show": "Afficher le journal", + + "user.interface": "Interface utilisateur", + "user.interface.appearance": "Apparence", + "user.interface.appearance.hint": "Sélectionnez la taille de police", + "user.interface.appearance.help": "Spécifie l'apparence de l'interface utilisateur", + "user.interface.appearance.small": "petite", + "user.interface.appearance.medium": "moyenne", + "user.interface.appearance.large": "grande", + "user.interface.pagesize.description": "Taille de la page", + "user.interface.pagesize.help": "Spécifie la taille de pagination dans les tableaux", + "user.interface.pagesize.hint": "Taille de la page", + "user.interface.byte.representation.description": "Sélectionnez la représentation des octets", + "user.interface.byte.representation.select": "Sélectionnez la représentation des octets", + "user.interface.byte.representation.help": "Spécifie la représentation des octets", + "user.language": "Langue", + + "lang.help": "Définit la langue de l'interface utilisateur", + "lang.select": "Sélectionnez la langue", + + "theme.select": "Sélectionnez un thème", + "theme.help": "Le thème actif actuel", + "theme.dark": "sombre", + "theme.light": "clair", "theme.pastel": "pastel", - "theme.ocean":"ocean" + "theme.ocean": "océan" } \ No newline at end of file diff --git a/src/assets/languages.json b/src/assets/languages.json index 4d8f04c..4324650 100644 --- a/src/assets/languages.json +++ b/src/assets/languages.json @@ -1,42 +1,42 @@ -[ - { +{ + "en-GB": { "label": "English", "code": "GB", "value": "en-GB" }, - { + "de-DE": { "label": "Deutsch", "code": "DE", "value": "de-DE" }, - { + "es-ES": { "label": "Español", "code": "ES", "value": "es-ES" }, - { + "fr-FR": { "label": "Français", "code": "FR", "value": "fr-FR" }, - { + "ru-RU": { "label": "Русский", "code": "RU", "value": "ru-RU" }, - { + "jp-JP": { "label": "日本語", "code": "JP", "value": "jp-JP" }, - { + "it-IT": { "label": "Italiano", "code": "IT", "value": "it-IT" }, - { + "pl-PL": { "label": "Polski", "code": "PL", "value": "pl-PL" } -] \ No newline at end of file +} \ No newline at end of file diff --git a/src/components/LanguageSelection.jsx b/src/components/LanguageSelection.jsx index fb8b180..2449dfa 100644 --- a/src/components/LanguageSelection.jsx +++ b/src/components/LanguageSelection.jsx @@ -1,8 +1,8 @@ import React, { useContext } from 'react'; -import { UIPreferencesContext } from '../contexts/UIPreferencesContext'; import languages from '../assets/languages.json' import Flags from 'country-flag-icons/react/3x2' import Select, { components } from "react-select"; +import { UIPreferencesContext } from '../contexts/UIPreferencesContext'; const { Option } = components; const LanguageOption = props => { @@ -15,16 +15,19 @@ const LanguageOption = props => { }; - export function LanguageSelection() { const { language, setLanguage } = useContext(UIPreferencesContext); + const allLanguages = Object.values(languages) return <> diff --git a/src/css/App.css b/src/css/App.css index 3c61deb..ac36532 100644 --- a/src/css/App.css +++ b/src/css/App.css @@ -12,11 +12,12 @@ body { } #select-language { - width: 10em; + width: 8em; + font-size: 90%; } #kopia .options-select { - overflow: ellipsis + overflow: ellipsis; } #kopia .btn-close { diff --git a/src/pages/Tasks.jsx b/src/pages/Tasks.jsx index 6bc06fa..eeabc89 100644 --- a/src/pages/Tasks.jsx +++ b/src/pages/Tasks.jsx @@ -3,48 +3,48 @@ import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import axios from 'axios'; import moment from 'moment'; -import React, { Component } from 'react'; +import React from 'react'; import Alert from 'react-bootstrap/Alert'; import Col from 'react-bootstrap/Col'; import Dropdown from 'react-bootstrap/Dropdown'; import Form from 'react-bootstrap/Form'; import Row from 'react-bootstrap/Row'; -import { Link } from 'react-router-dom'; -import { handleChange } from '../forms'; import KopiaTable from '../utils/KopiaTable'; +import { Link } from 'react-router-dom'; import { redirect, taskStatusSymbol } from '../utils/uiutil'; -import i18n from '../utils/18ns' - -export class Tasks extends Component { - constructor() { - super(); - this.state = { - items: [], - isLoading: false, - error: null, - showKind: "All", - showStatus: "All", - uniqueKinds: [], - }; - - this.handleChange = handleChange.bind(this); - this.fetchTasks = this.fetchTasks.bind(this); - this.interval = window.setInterval(this.fetchTasks, 3000); - } - - componentDidMount() { - this.setState({ - isLoading: true, +import { useTranslation } from "react-i18next"; +import { useState, useLayoutEffect, useCallback } from 'react'; + +export function Tasks() { + const [isLoading, setIsLoading] = useState(false); + const [searchDescription, setDescription] = useState("") + const [response, setResponse] = useState({ items: [], kinds: [] }); + const [kind, setKind] = useState("All"); + const [status, setStatus] = useState("All"); + const [error, setError] = useState(); + const { t } = useTranslation(); + + const fetchTasks = useCallback(() => { + axios.get('/api/v1/tasks').then(result => { + setIsLoading(false); + setResponse({ items: result.data.tasks, kinds: getUniqueKinds(result.data.tasks) }); + }).catch(error => { + redirect(error); + setError(error); + setIsLoading(false); }); + }, []) + + useLayoutEffect(() => { + setIsLoading(true) + fetchTasks() + let interval = setInterval(fetchTasks, 5000) + return () => { + window.clearInterval(interval); + }; + }, [fetchTasks]); - this.fetchTasks(); - } - - componentWillUnmount() { - window.clearInterval(this.interval); - } - - getUniqueKinds(tasks) { + function getUniqueKinds(tasks) { let o = {}; for (const tsk of tasks) { @@ -59,112 +59,97 @@ export class Tasks extends Component { return result; } - fetchTasks() { - axios.get('/api/v1/tasks').then(result => { - this.setState({ - items: result.data.tasks, - uniqueKinds: this.getUniqueKinds(result.data.tasks), - isLoading: false, - }); - }).catch(error => { - redirect(error); - this.setState({ - error, - isLoading: false - }); - }); + function handleDescription(desc) { + setDescription(desc.target.value) } - taskMatches(t) { - if (this.state.showKind !== "All" && t.kind !== this.state.showKind) { + function taskMatches(t) { + if (kind !== "All" && t.kind !== kind) { return false; } - if (this.state.showStatus !== "All" && t.status.toLowerCase() !== this.state.showStatus.toLowerCase()) { + if (status !== "All" && t.status.toLowerCase() !== status.toLowerCase()) { return false; } - if (this.state.searchDescription && t.description.indexOf(this.state.searchDescription) < 0) { + if (searchDescription && t.description.indexOf(searchDescription) < 0) { return false; } return true } - filterItems(items) { - return items.filter(c => this.taskMatches(c)) + function filterItems(items) { + return items.filter(c => taskMatches(c)) } - render() { - const { items, isLoading, error } = this.state; - if (error) { - return

{error.message}

; - } - if (isLoading) { - return

{i18n.t('task.loading')}

; - } + if (error) { + return

{error.message}

; + } + if (isLoading) { + return

{t('task.loading')}

; + } - const columns = [{ - Header: i18n.t('task.time.start'), - width: 160, - accessor: x => - {moment(x.startTime).fromNow()} - - }, { - Header: i18n.t('task.status'), - width: 240, - accessor: x => taskStatusSymbol(x), - }, { - Header: i18n.t('task.kind'), - width: "", - accessor: x =>

{x.kind}

, - }, { - Header: i18n.t('task.description'), - width: "", - accessor: x =>

{x.description}

, - }] - - const filteredItems = this.filterItems(items) - - return <> + const columns = [{ + Header: t('task.header.time.start'), + width: 160, + accessor: x => + {moment(x.startTime).fromNow()} + + }, { + Header: t('task.header.status'), + width: 240, + accessor: x => taskStatusSymbol(x), + }, { + Header: t('task.header.kind'), + width: "", + accessor: x =>

{x.kind}

, + }, { + Header: t('task.header.description'), + width: "", + accessor: x =>

{x.description}

, + }] + + const filteredItems = filterItems(response.items) + return ( + <>
- Status: {this.state.showStatus} + {t('task.header.status')}: {status} - this.setState({ showStatus: "All" })}>{i18n.t('task.all')} + setStatus("All")}>{t('task.all')} - this.setState({ showStatus: "Running" })}>{i18n.t('task.running')} - this.setState({ showStatus: "Failed" })}>{i18n.t('task.failed')} + setStatus("Running")}>{t('task.running')} + setStatus("Failed")}>{t('task.failed')} - Kind: {this.state.showKind} + {t('task.header.kind')}: {kind} - this.setState({ showKind: "All" })}>{i18n.t('task.all')} + setKind("All")}>{t('task.all')} - {this.state.uniqueKinds.map(k => this.setState({ showKind: k })}>{k})} + {response.kinds.map(kind => setKind(kind)}>{kind})} - +
- {!items.length ? + {!response.items.length ? - A list of tasks will appear here when you create snapshots, restore, run maintenance, etc. + {t('task.feedback.entries')} : }
- ; - } + ); } diff --git a/src/utils/18ns.js b/src/utils/18ns.js index 6274a3b..dedb034 100644 --- a/src/utils/18ns.js +++ b/src/utils/18ns.js @@ -9,15 +9,13 @@ i18n .use(initReactI18next) .init({ fallbackLng: "en-GB", - deubg: true, ns: ["translation"], defaultNS: "translation", interpolation: { escapeValue: false, }, - react: { - wait: true - } + react: + { useSuspense: true } }); export default i18n; \ No newline at end of file