Skip to content

Commit 15b835d

Browse files
committed
Export page backend localization
1 parent d1a08fb commit 15b835d

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

app/export/src/js/index.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { aes, convert, time } = require("@levminer/lib")
1+
const { aes, convert, time, localization } = require("@levminer/lib")
22
const logger = require("@levminer/lib/logger/renderer")
33
const { app, dialog } = require("@electron/remote")
44
const { ipcRenderer: ipc } = require("electron")
@@ -18,6 +18,13 @@ window.onerror = (error) => {
1818
*/
1919
logger.getWindow("export")
2020

21+
/**
22+
* Localization
23+
*/
24+
localization.localize("export")
25+
26+
const lang = localization.getLang()
27+
2128
/**
2229
* Check if running in development
2330
*/
@@ -119,8 +126,8 @@ const go = (data) => {
119126
const saveFile = () => {
120127
dialog
121128
.showSaveDialog({
122-
title: "Save as Text file",
123-
filters: [{ name: "Text file", extensions: ["txt"] }],
129+
title: lang.import_dialog.save_file,
130+
filters: [{ name: lang.export_dialog.text_file, extensions: ["txt"] }],
124131
defaultPath: "~/authme_export.txt",
125132
})
126133
.then((result) => {
@@ -148,8 +155,8 @@ const saveFile = () => {
148155
const newSaveFile = () => {
149156
dialog
150157
.showSaveDialog({
151-
title: "Save as Authme file",
152-
filters: [{ name: "Authme file", extensions: ["authme"] }],
158+
title: lang.import_dialog.save_file,
159+
filters: [{ name: lang.application_dialog.authme_file, extensions: ["authme"] }],
153160
defaultPath: "~/export.authme",
154161
})
155162
.then((result) => {
@@ -189,8 +196,8 @@ const newSaveFile = () => {
189196
const saveQrCodes = () => {
190197
dialog
191198
.showSaveDialog({
192-
title: "Save as HTML file",
193-
filters: [{ name: "HTML file", extensions: ["html"] }],
199+
title: lang.import_dialog.save_file,
200+
filters: [{ name: lang.export_dialog.html_file, extensions: ["html"] }],
194201
defaultPath: "~/authme_export.html",
195202
})
196203
.then((result) => {
@@ -229,13 +236,14 @@ const hide = () => {
229236
* No saved codes found
230237
*/
231238
const error = () => {
232-
fs.readFile(path.join(folder_path, "codes", "codes.authme"), "utf-8", (err, content) => {
239+
fs.readFile(path.join(folder_path, "codes", "codes.authme"), "utf-8", (err) => {
233240
if (err) {
234241
dialog.showMessageBox({
235242
title: "Authme",
236-
buttons: ["Close"],
243+
buttons: [lang.button.close],
244+
noLink: true,
237245
type: "error",
238-
message: "No save file found. \n\nGo back to the main page and save your codes!",
246+
message: lang.export_dialog.no_save_found,
239247
})
240248
}
241249
})

0 commit comments

Comments
 (0)