From 9a29fa799caa071f83979b1822748e6e076e2e7b Mon Sep 17 00:00:00 2001 From: Alexandre_BRAVO Date: Fri, 29 Nov 2024 17:28:47 +0100 Subject: [PATCH] traduction (en-fr-de-es-it-pt) --- src/App.vue | 17 ++- src/assets/traduction.json | 194 +++++++++++++++++++++++++++- src/components/EditFileName.vue | 10 +- src/components/FileExistsDialog.vue | 32 +++-- src/components/FileTable.vue | 60 ++++----- src/components/WebContentViewer.vue | 10 +- 6 files changed, 262 insertions(+), 61 deletions(-) diff --git a/src/App.vue b/src/App.vue index a647972..35c6516 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,12 +5,12 @@
- +
- +
@@ -21,6 +21,16 @@ import FileTable from './components/FileTable.vue'; import WebContentViewer from './components/WebContentViewer.vue'; import './output.css'; +// Traduction +import i18next from "i18next"; +import file from "./assets/traduction.json"; + +await i18next.init({ + lng: navigator.language.split('-')[0], + fallbackLng: "en", + resources: file, +}); + export default { name: 'App', components: { @@ -46,6 +56,9 @@ export default { this.zip = null; this.sharedFile = null; }, + translate(id) { + return i18next.t(id) + }, }, } diff --git a/src/assets/traduction.json b/src/assets/traduction.json index 597c0ab..9172f43 100644 --- a/src/assets/traduction.json +++ b/src/assets/traduction.json @@ -1,14 +1,200 @@ { "en": { "translation": { - "welcome": "Welcome to the app!", - "hello": "Hello, {{name}}!" + "all.files" : "All files", + "favorites": "Favorites", + "no.content": "No content to display", + "enter.file.name": "Enter the name of the file", + "modify.file.name": "Modify the name of the file", + "you.are.going.to.erase.file.folder" : "You are going to erase the file/folder", + "apply.to.all.*" : "Apply to all*", + "*.text" : "* You can't undo this action", + "create.new.file": "Create a new file", + "name.of.file": "Name of the file", + "change.file.name": "Change the name of the file", + "file.already.exist" : "The file already exists", + "file.pt.1" : "The file \"", + "file.pt.2" : "\" already exists, what do you want to do ?", + "cant.rename": "You can't rename the file/folder : ", + "cant.create.folder": "You can't create the folder : ", + "already.exists": ", because it already exists.", + "name": "Name", + "size": "Size", + "type": "Type", + "options": "Options", + "new": "New", + "delete": "Delete", + "edit": "Edit", + "cancel": "Cancel", + "confirm": "Confirm", + "create": "Create", + "overwrite": "Overwrite", + "rename": "Rename" } }, "fr": { "translation": { - "welcome": "Bienvenue dans l'application !", - "hello": "Bonjour, {{name}} !" + "all.files": "Tous les fichiers", + "favorites": "Favoris", + "no.content": "Aucun contenu à afficher", + "enter.file.name": "Entrez le nom du fichier", + "modify.file.name": "Modifier le nom du fichier", + "you.are.going.to.erase.file.folder": "Vous allez supprimer le fichier/dossier", + "apply.to.all.*": "Appliquer à tous*", + "*.text": "* Vous ne pouvez pas annuler cette action", + "create.new.file": "Créer un nouveau fichier", + "name.of.file": "Nom du fichier", + "change.file.name": "Changer le nom du fichier", + "file.already.exist": "Le fichier existe déjà", + "file.pt.1": "Le fichier \"", + "file.pt.2": "\" existe déjà, que voulez-vous faire ?", + "cant.rename": "Vous ne pouvez pas renommer le fichier/dossier : ", + "cant.create.folder": "Vous ne pouvez pas créer le dossier : ", + "already.exists": ", car il existe déjà.", + "name": "Nom", + "size": "Taille", + "type": "Type", + "options": "Options", + "new": "Nouveau", + "delete": "Supprimer", + "edit": "Modifier", + "cancel": "Annuler", + "confirm": "Confirmer", + "create": "Créer", + "overwrite": "Écraser", + "rename": "Renommer" + } + }, + "de": { + "translation": { + "all.files" : "Alle Dateien", + "favorites": "Favoriten", + "no.content": "Kein Inhalt zum Anzeigen", + "enter.file.name": "Geben Sie den Namen der Datei ein", + "modify.file.name": "Ändern Sie den Namen der Datei", + "you.are.going.to.erase.file.folder" : "Sie sind dabei, die Datei/den Ordner zu löschen", + "apply.to.all.*" : "Auf alle anwenden*", + "*.text" : "* Diese Aktion kann nicht rückgängig gemacht werden", + "create.new.file": "Neue Datei erstellen", + "name.of.file": "Name der Datei", + "change.file.name": "Ändern Sie den Namen der Datei", + "file.already.exist" : "Die Datei existiert bereits", + "file.pt.1" : "Die Datei \"", + "file.pt.2" : "\" existiert bereits, was möchten Sie tun?", + "cant.rename": "Die Datei/der Ordner kann nicht umbenannt werden: ", + "cant.create.folder": "Der Ordner kann nicht erstellt werden: ", + "already.exists": ", da er bereits existiert.", + "name": "Name", + "size": "Größe", + "type": "Typ", + "options": "Optionen", + "new": "Neu", + "delete": "Löschen", + "edit": "Bearbeiten", + "cancel": "Abbrechen", + "confirm": "Bestätigen", + "create": "Erstellen", + "overwrite": "Überschreiben", + "rename": "Umbenennen" + } + }, + "es": { + "translation": { + "all.files": "Todos los archivos", + "favorites": "Favoritos", + "no.content": "No hay contenido para mostrar", + "enter.file.name": "Introduce el nombre del archivo", + "modify.file.name": "Modificar el nombre del archivo", + "you.are.going.to.erase.file.folder": "Vas a eliminar el archivo/carpeta", + "apply.to.all.*": "Aplicar a todos*", + "*.text": "* No puedes deshacer esta acción", + "create.new.file": "Crear un nuevo archivo", + "name.of.file": "Nombre del archivo", + "change.file.name": "Cambiar el nombre del archivo", + "file.already.exist": "El archivo ya existe", + "file.pt.1": "El archivo \"", + "file.pt.2": "\" ya existe, ¿qué quieres hacer?", + "cant.rename": "No puedes renombrar el archivo/carpeta: ", + "cant.create.folder": "No puedes crear la carpeta: ", + "already.exists": ", porque ya existe.", + "name": "Nombre", + "size": "Tamaño", + "type": "Tipo", + "options": "Opciones", + "new": "Nuevo", + "delete": "Eliminar", + "edit": "Editar", + "cancel": "Cancelar", + "confirm": "Confirmar", + "create": "Crear", + "overwrite": "Sobrescribir", + "rename": "Renombrar" + } + }, + "pt": { + "translation": { + "all.files" : "Todos os arquivos", + "favorites": "Favoritos", + "no.content": "Nenhum conteúdo para exibir", + "enter.file.name": "Digite o nome do arquivo", + "modify.file.name": "Modificar o nome do arquivo", + "you.are.going.to.erase.file.folder" : "Você está prestes a apagar o arquivo/pasta", + "apply.to.all.*" : "Aplicar a todos*", + "*.text" : "* Esta ação não pode ser desfeita", + "create.new.file": "Criar um novo arquivo", + "name.of.file": "Nome do arquivo", + "change.file.name": "Alterar o nome do arquivo", + "file.already.exist" : "O arquivo já existe", + "file.pt.1" : "O arquivo \"", + "file.pt.2" : "\" já existe, o que você deseja fazer?", + "cant.rename": "Não é possível renomear o arquivo/pasta: ", + "cant.create.folder": "Não é possível criar a pasta: ", + "already.exists": ", porque já existe.", + "name": "Nome", + "size": "Tamanho", + "type": "Tipo", + "options": "Opções", + "new": "Novo", + "delete": "Excluir", + "edit": "Editar", + "cancel": "Cancelar", + "confirm": "Confirmar", + "create": "Criar", + "overwrite": "Sobrescrever", + "rename": "Renomear" + } + }, + "it": { + "translation": { + "all.files" : "Tutti i file", + "favorites": "Preferiti", + "no.content": "Nessun contenuto da visualizzare", + "enter.file.name": "Inserisci il nome del file", + "modify.file.name": "Modifica il nome del file", + "you.are.going.to.erase.file.folder" : "Stai per cancellare il file/la cartella", + "apply.to.all.*" : "Applica a tutti*", + "*.text" : "* Non puoi annullare questa azione", + "create.new.file": "Crea un nuovo file", + "name.of.file": "Nome del file", + "change.file.name": "Cambia il nome del file", + "file.already.exist" : "Il file esiste già", + "file.pt.1" : "Il file \"", + "file.pt.2" : "\" esiste già, cosa vuoi fare?", + "cant.rename": "Non puoi rinominare il file/la cartella: ", + "cant.create.folder": "Non puoi creare la cartella: ", + "already.exists": ", perché esiste già.", + "name": "Nome", + "size": "Dimensione", + "type": "Tipo", + "options": "Opzioni", + "new": "Nuovo", + "delete": "Elimina", + "edit": "Modifica", + "cancel": "Annulla", + "confirm": "Conferma", + "create": "Crea", + "overwrite": "Sovrascrivi", + "rename": "Rinomina" } } } \ No newline at end of file diff --git a/src/components/EditFileName.vue b/src/components/EditFileName.vue index deb69eb..5824128 100644 --- a/src/components/EditFileName.vue +++ b/src/components/EditFileName.vue @@ -1,7 +1,7 @@