Skip to content

Commit 65518e7

Browse files
André DietrichAndré Dietrich
authored andcommitted
interantionalization of the file explorer
1 parent 5421e6d commit 65518e7

28 files changed

Lines changed: 362 additions & 36 deletions

src/components/FileExplorer.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default defineComponent({
135135
// -- operations ----------------------------------------------------------
136136
137137
createFile(folder = "") {
138-
const name = window.prompt("New file name:", "untitled.txt");
138+
const name = window.prompt(this.$t("fileExplorer.newFileName"), this.$t("fileExplorer.newFileDefault"));
139139
if (!name) return;
140140
const path = folder ? folder + "/" + name : name;
141141
const created = this.doc?.createFile(path) || path;
@@ -146,7 +146,7 @@ export default defineComponent({
146146
},
147147
148148
createFolder(folder = "") {
149-
const name = window.prompt("New folder name:", "folder");
149+
const name = window.prompt(this.$t("fileExplorer.newFolderName"), this.$t("fileExplorer.newFolderDefault"));
150150
if (!name) return;
151151
const path = folder ? folder + "/" + name : name;
152152
this.doc?.createFolder(path);
@@ -155,16 +155,18 @@ export default defineComponent({
155155
},
156156
157157
rename(node: TreeNode) {
158-
const next = window.prompt("Rename to:", node.name);
158+
const next = window.prompt(this.$t("fileExplorer.renameTo"), node.name);
159159
if (!next || next === node.name) return;
160160
const parent = node.path.split("/").slice(0, -1).join("/");
161161
const target = parent ? parent + "/" + next : next;
162162
this.doc?.renamePath(node.path, target);
163163
},
164164
165165
remove(node: TreeNode) {
166-
const label = node.type === "folder" ? "folder (and its contents)" : "file";
167-
if (!window.confirm(`Delete ${label} "${node.path}"?`)) return;
166+
const label = node.type === "folder"
167+
? this.$t("fileExplorer.labelFolder")
168+
: this.$t("fileExplorer.labelFile");
169+
if (!window.confirm(this.$t("fileExplorer.deleteConfirm", { label, path: node.path }))) return;
168170
this.doc?.deletePath(node.path);
169171
},
170172
@@ -252,19 +254,19 @@ export default defineComponent({
252254
@drop="onRootDrop"
253255
>
254256
<div class="lia-explorer-header">
255-
<span class="lia-explorer-title">FILES</span>
257+
<span class="lia-explorer-title">{{ $t('fileExplorer.title') }}</span>
256258
<span class="lia-explorer-tools">
257259
<i
258260
class="bi bi-file-earmark-plus"
259-
title="New file"
261+
:title="$t('fileExplorer.newFile')"
260262
@click="createFile('')"
261263
></i>
262264
<i
263265
class="bi bi-folder-plus"
264-
title="New folder"
266+
:title="$t('fileExplorer.newFolder')"
265267
@click="createFolder('')"
266268
></i>
267-
<i class="bi bi-upload" title="Upload files" @click="triggerUpload"></i>
269+
<i class="bi bi-upload" :title="$t('fileExplorer.upload')" @click="triggerUpload"></i>
268270
</span>
269271
</div>
270272

src/i18n/am.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,16 @@
291291
"all": "ሁሉም",
292292
"blink": "ብልጭታ",
293293
"solid": "ጠንካራ"
294+
},
295+
"fileExplorer": {
296+
"title": "ፋይሎች",
297+
"newFile": "አዲስ ፋይል",
298+
"newFolder": "አዲስ አቃፊ",
299+
"upload": "ፋይሎችን ስቀል",
300+
"newFileName": "የአዲሱ ፋይል ስም:",
301+
"renameTo": "ዳግም ሰይም ወደ:",
302+
"labelFile": "ፋይሉን",
303+
"labelFolder": "አቃፊውን (እና ይዘቱን)",
304+
"deleteConfirm": "{label} \"{path}\" ሰርዝ?"
294305
}
295-
}
306+
}

src/i18n/ar.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,16 @@
291291
"all": "الكل",
292292
"blink": "وميض",
293293
"solid": "ثابت"
294+
},
295+
"fileExplorer": {
296+
"title": "الملفات",
297+
"newFile": "ملف جديد",
298+
"newFolder": "مجلد جديد",
299+
"upload": "رفع الملفات",
300+
"newFileName": "اسم الملف الجديد:",
301+
"renameTo": "إعادة التسمية إلى:",
302+
"labelFile": "ملف",
303+
"labelFolder": "مجلد (ومحتوياته)",
304+
"deleteConfirm": "حذف {label} \"{path}\"؟"
294305
}
295-
}
306+
}

src/i18n/bg.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,17 @@
291291
"all": "Всички",
292292
"blink": "Мигане",
293293
"solid": "Плътен"
294+
},
295+
"fileExplorer": {
296+
"title": "ФАЙЛОВЕ",
297+
"newFile": "Нов файл",
298+
"newFolder": "Нова папка",
299+
"upload": "Качване на файлове",
300+
"newFileName": "Име на новия файл:",
301+
"newFolderName": "Име на новата папка:",
302+
"renameTo": "Преименуване на:",
303+
"labelFile": "файл",
304+
"labelFolder": "папка (и нейното съдържание)",
305+
"deleteConfirm": "Изтриване на {label} \"{path}\"?"
294306
}
295-
}
307+
}

src/i18n/cs.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,17 @@
291291
"all": "Vše",
292292
"blink": "Blikání",
293293
"solid": "Plný"
294+
},
295+
"fileExplorer": {
296+
"title": "SOUBORY",
297+
"newFile": "Nový soubor",
298+
"newFolder": "Nová složka",
299+
"upload": "Nahrát soubory",
300+
"newFileName": "Název nového souboru:",
301+
"newFolderName": "Název nové složky:",
302+
"renameTo": "Přejmenovat na:",
303+
"labelFile": "soubor",
304+
"labelFolder": "složku (a její obsah)",
305+
"deleteConfirm": "Smazat {label} \"{path}\"?"
294306
}
295-
}
307+
}

src/i18n/da.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,17 @@
291291
"all": "Alle",
292292
"blink": "Blink",
293293
"solid": "Fast"
294+
},
295+
"fileExplorer": {
296+
"title": "FILER",
297+
"newFile": "Ny fil",
298+
"newFolder": "Ny mappe",
299+
"upload": "Upload filer",
300+
"newFileName": "Nyt filnavn:",
301+
"newFolderName": "Nyt mappenavn:",
302+
"renameTo": "Omdøb til:",
303+
"labelFile": "fil",
304+
"labelFolder": "mappe (og dens indhold)",
305+
"deleteConfirm": "Slet {label} \"{path}\"?"
294306
}
295-
}
307+
}

src/i18n/de.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,17 @@
292292
"all": "Alle",
293293
"blink": "Blinken",
294294
"solid": "Fest"
295+
},
296+
"fileExplorer": {
297+
"title": "DATEIEN",
298+
"newFile": "Neue Datei",
299+
"newFolder": "Neuer Ordner",
300+
"upload": "Dateien hochladen",
301+
"newFileName": "Name der neuen Datei:",
302+
"newFolderName": "Name des neuen Ordners:",
303+
"renameTo": "Umbenennen in:",
304+
"labelFile": "Datei",
305+
"labelFolder": "Ordner (und seinen Inhalt)",
306+
"deleteConfirm": "{label} \"{path}\" löschen?"
295307
}
296-
}
308+
}

src/i18n/el.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,17 @@
291291
"all": "Όλα",
292292
"blink": "Αναβοσβήσιμο",
293293
"solid": "Σταθερό"
294+
},
295+
"fileExplorer": {
296+
"title": "ΑΡΧΕΙΑ",
297+
"newFile": "Νέο αρχείο",
298+
"newFolder": "Νέος φάκελος",
299+
"upload": "Μεταφόρτωση αρχείων",
300+
"newFileName": "Όνομα νέου αρχείου:",
301+
"newFolderName": "Όνομα νέου φακέλου:",
302+
"renameTo": "Μετονομασία σε:",
303+
"labelFile": "αρχείο",
304+
"labelFolder": "φάκελο (και το περιεχόμενό του)",
305+
"deleteConfirm": "Διαγραφή {label} \"{path}\";"
294306
}
295-
}
307+
}

src/i18n/en.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,19 @@
292292
"all": "All",
293293
"blink": "Blink",
294294
"solid": "Solid"
295+
},
296+
"fileExplorer": {
297+
"title": "FILES",
298+
"newFile": "New file",
299+
"newFolder": "New folder",
300+
"upload": "Upload files",
301+
"newFileName": "New file name:",
302+
"newFileDefault": "untitled.txt",
303+
"newFolderName": "New folder name:",
304+
"newFolderDefault": "folder",
305+
"renameTo": "Rename to:",
306+
"labelFile": "file",
307+
"labelFolder": "folder (and its contents)",
308+
"deleteConfirm": "Delete {label} \"{path}\"?"
295309
}
296-
}
310+
}

src/i18n/es.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,17 @@
291291
"all": "Todo",
292292
"blink": "Parpadeo",
293293
"solid": "Sólido"
294+
},
295+
"fileExplorer": {
296+
"title": "ARCHIVOS",
297+
"newFile": "Nuevo archivo",
298+
"newFolder": "Nueva carpeta",
299+
"upload": "Subir archivos",
300+
"newFileName": "Nombre del nuevo archivo:",
301+
"newFolderName": "Nombre de la nueva carpeta:",
302+
"renameTo": "Renombrar a:",
303+
"labelFile": "archivo",
304+
"labelFolder": "carpeta (y su contenido)",
305+
"deleteConfirm": "¿Eliminar {label} \"{path}\"?"
294306
}
295-
}
307+
}

0 commit comments

Comments
 (0)