Skip to content

Commit

Permalink
Export page localisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Jan 12, 2024
1 parent 4d5331c commit 987fa6c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 10 additions & 7 deletions interface/windows/export/export.svelte
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<div class="transparent-900 saveExportedCodes m-auto my-20 hidden w-4/5 rounded-2xl p-10 text-left">
<h1 class="px-10">Export codes</h1>
<h1 class="px-10">{language.export.exportCodes}</h1>
<div class="mx-auto flex flex-col items-center justify-center rounded-2xl p-10">
<div class="transparent-800 mb-5 flex w-full flex-row items-center justify-between rounded-xl p-5 text-left">
<div>
<h2>Export .authme file</h2>
<h3>Ideal to import for Authme or other Authme apps.</h3>
<h2>{language.export.exportAuthmeFile}</h2>
<h3>{language.export.exportAuthmeFileText}</h3>
</div>
<div class="ml-20 flex gap-3">
<button class="button" on:click={exportAuthmeFile}>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4" /><polyline points="14 2 14 8 20 8" /><path d="M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1" /><path d="M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1" /></svg>
Export file
{language.export.exportFileButton}
</button>
</div>
</div>

<div class="transparent-800 flex w-full flex-row items-center justify-between rounded-xl p-5 text-left">
<div>
<h2>Export .html file</h2>
<h3>Ideal for scanning the QR codes or for security backup.</h3>
<h2>{language.export.exportHTMlFile}</h2>
<h3>{language.export.exportHTMlFileText}</h3>
</div>
<div class="ml-20 flex gap-3">
<button class="button" on:click={exportHtmlFile}>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4" /><polyline points="14 2 14 8 20 8" /><path d="m9 18 3-3-3-3" /><path d="m5 12-3 3 3 3" /></svg>
Export file
{language.export.exportFileButton}
</button>
</div>
</div>
Expand All @@ -32,6 +32,9 @@
<script lang="ts">
import { onMount } from "svelte"
import { exportCodes, exportAuthmeFile, exportHtmlFile } from "./index"
import { getLanguage } from "@utils/language"
const language = getLanguage()
onMount(() => {
exportCodes()
Expand Down
4 changes: 3 additions & 1 deletion interface/windows/export/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { getSettings } from "../../stores/settings"
import qrcode from "qrcode-generator"
import { decryptData, verifyWebAuthnLogin } from "interface/utils/encryption"
import { navigate } from "@utils/navigate"
import { getLanguage } from "@utils/language"

let codesArray: LibImportFile
let codesText: string
const language = getLanguage()

/**
* Export the saved codes
Expand All @@ -33,7 +35,7 @@ export const exportCodes = async () => {
codesArray = textConverter(decryptedText, 0)
codesText = decryptedText
} else {
dialog.message("No save file found. \n\nGo to the codes or the import page and import your codes!", { type: "error" })
dialog.message(language.codes.dialog.noSaveFileFound, { type: "error" })

return navigate("import")
}
Expand Down

0 comments on commit 987fa6c

Please sign in to comment.