Skip to content

Commit

Permalink
Codes page and wording fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Jan 22, 2024
1 parent ecfa77e commit f964287
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 63 deletions.
33 changes: 14 additions & 19 deletions interface/utils/language/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,8 @@ export const localeEN = {

codes: {
importCodes: "Import your 2FA codes",
importCodesText: "Import your existing 2FA codes, or choose your Authme import file if you already have one.",
importCodesText: "Import your existing 2FA codes on the Import page.",
importCodesButton: "Import codes",
chooseFileButton: "Choose file",
gettingStarted: "Getting started",
gettingStartedText: "In the mean time you can check out the settings or visit the GitHub page.",
settingsButton: "Settings",
githubButton: "GitHub",
noSearchResultsFound: "No search results found",
noSearchResultsFoundText: "Not found search results for",
dialog: {
Expand All @@ -86,25 +81,25 @@ export const localeEN = {
googleAuthQRCodeText: "If you are using Google Authenticator you can export all of your exiting codes and import them to Authme.",
chooseImportMethod: "Choose import method",
importFromImage: "Import from image",
importFromImageText: "Choose images that contain compatible QR codes.",
importFromImageText: "Choose an image that contains a compatible QR code.",
chooseImageButton: "Choose image",
enterSecretManually: "Enter secret manually",
enterSecretManuallyText: "Enter a TOTP secret key and name manually.",
enterSecretManuallyButton: "Manual entry",
enterSecretManually: "Enter a setup key",
enterSecretManuallyText: "Enter a TOTP secret key and name.",
enterSecretManuallyButton: "Setup a key",
screenCapture: "Screen capture",
screenCaptureText: "Capture a 2FA QR code from your screen.",
screenCaptureButton: "Capture screen",
webcam: "Webcam",
webcamText: "Use your webcam to scan a 2FA QR code.",
webcamButton: "Use webcam",
authmeFile: "Authme file",
authmeFileText: "Import all codes from an Authme import file.",
authmeFileText: "Import all codes from an existing Authme import file.",
authmeFileButton: "Choose file",
// html dialogs
captureScreenTitle: "Capture screen import",
captureScreenWaiting: "Waiting for a QR code...",
manualEntry: "Manual entry",
manualEntryText: "Please enter the 2FA secret and name!",
manualEntry: "Setup a key",
manualEntryText: "Please enter a name and a 2FA secret key.",
manualEntryName: "Name (Required)",
manualEntrySecret: "Secret (Required)",
manualEntryDescription: "Description",
Expand Down Expand Up @@ -142,23 +137,23 @@ export const localeEN = {
settings: {
general: "General",
launchOnStartup: "Launch on startup",
launchOnStartupText: "Start Authme after your computer started. Authme will start minimized on the system tray",
launchOnStartupText: "Launch Authme automatically upon system startup on the system tray.",
minimizeToTray: "Minimize to tray",
minimizeToTrayText: "When closing the app Authme will not quit. You can open Authme from the system tray.",
optionalAnalytics: "Optional analytics",
optionalAnalyticsText: "Send optional analytics, the sent data is completely anonymous. This includes your Authme version and your OS version",
optionalAnalyticsText: "The sent payload is completely anonymous. The send data includes your Authme version and information about your computer.",
windowCapture: "Window capture",
windowCaptureText: "By default Authme can't be captured by outside programs. If you turn this on it applies until you restart Authme",
windowCaptureText: "By default Authme can't be captured by outside programs. If you turn this on it applies until you restart Authme.",
clearData: "Clear data",
clearDataText: "Clear password, 2FA codes and all other settings. Be careful, this can not be undone",
clearDataText: "Clear password, 2FA codes and all other settings. Be careful, this can not be undone!",
clearDataButton: "Clear data",
codes: "Codes",
codesDescription: "Codes description",
codesDescriptionText: "2FA codes description will be visible. You can copy it after clicking it.",
blurCodes: "Blur codes",
blurCodesText: "Blur the saved codes. You can still copy the codes or hover over the codes to show them",
blurCodesText: "Blur the saved codes. You can still copy the codes or hover over the codes to show them.",
codesLayout: "Codes layout",
codesLayoutText: "You can choose your preferred layout. Grid displays more items and adapts to the screen size",
codesLayoutText: "You can choose your preferred layout. Grid displays more items and adapts to the screen size.",
sortCodes: "Sort codes",
sortCodesText: "You can choose how to sort the codes. By default codes are sorted by importing order.",
shortcuts: "Shortcuts",
Expand Down
21 changes: 1 addition & 20 deletions interface/windows/codes/codes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,6 @@
<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="M2 15h10" /><path d="m9 18 3-3-3-3" /></svg>
{language.codes.importCodesButton}
</button>
<button class="button" on:click={chooseImportFile}>
<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 2v3" /><polyline points="14 2 14 8 20 8" /><path d="M5 17a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" /><path d="m9 18-1.5-1.5" /></svg>
{language.codes.chooseFileButton}
</button>
</div>
</div>

<div class="gettingStarted transparent-800 hidden w-full max-w-2xl rounded-2xl p-5">
<h2>{language.codes.gettingStarted}</h2>
<h3>{language.codes.gettingStartedText}</h3>
<div class="mx-auto mt-6 flex flex-row items-center justify-center gap-3 sm:flex-wrap">
<button class="button" on:click={() => navigate("settings")}>
<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="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" /><circle cx="12" cy="12" r="3" /></svg>
{language.codes.settingsButton}
</button>
<button class="button" on:click={() => open("https://github.com/levminer/authme")}>
<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="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4" /><path d="M9 18c-4.51 2-5-2-7-2" /></svg>
{language.codes.githubButton}
</button>
</div>
</div>

Expand All @@ -54,7 +35,7 @@

<script lang="ts">
import { onMount, onDestroy } from "svelte"
import { stopCodesRefresher, search, chooseImportFile, loadCodes } from "./index"
import { stopCodesRefresher, search, loadCodes } from "./index"
import { navigate, open } from "../../utils/navigate"

Check warning on line 39 in interface/windows/codes/codes.svelte

View workflow job for this annotation

GitHub Actions / build

'open' is defined but never used
import SearchFilter from "../../components/searchFilter.svelte"
import { getLanguage } from "@utils/language"
Expand Down
25 changes: 2 additions & 23 deletions interface/windows/codes/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { decodeBase64, textConverter } from "../../utils/convert"
import { textConverter } from "../../utils/convert"
import { TOTP } from "otpauth"
import { clipboard, dialog, fs } from "@tauri-apps/api"
import { clipboard } from "@tauri-apps/api"
import { getSettings, setSettings } from "../../stores/settings"
import { getState, setState } from "../../stores/state"
import { decryptData, encryptData } from "interface/utils/encryption"
Expand All @@ -20,7 +20,6 @@ export const generateCodeElements = (data: LibImportFile) => {
const issuers = data.issuers

document.querySelector(".importCodes").style.display = "none"
document.querySelector(".gettingStarted").style.display = "none"
document.querySelector(".searchContainer").style.display = "flex"

const generate = () => {
Expand Down Expand Up @@ -254,25 +253,6 @@ export const search = () => {
}
}

export const chooseImportFile = async () => {
const filePath = await dialog.open({ filters: [{ name: "Authme file", extensions: ["authme"] }] })

if (filePath !== null) {
const loadedFile = await fs.readTextFile(filePath.toString())
const file: LibAuthmeFile = JSON.parse(loadedFile)
const importString = decodeBase64(file.codes)

saveText = importString

dialog.message(language.codes.dialog.codesImported)

state.importData = importString
setState(state)

generateCodeElements(textConverter(importString, 0))
}
}

const saveCodes = async () => {
const encryptedText = await encryptData(saveText)

Expand All @@ -293,7 +273,6 @@ export const loadCodes = async () => {
} else {
// No saved and no imported codes
document.querySelector(".importCodes").style.display = "block"
document.querySelector(".gettingStarted").style.display = "block"
}

if (savedCodes === true) {
Expand Down
2 changes: 1 addition & 1 deletion interface/windows/landing/landing.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<h4>{language.landing.hardwareAuth}</h4>
<h5>{language.landing.hardwareAuthText}</h5>
</div>
<div class="ml-20 flex gap-3">
<div class="ml-20 sm:ml-0 flex gap-3 sm:mt-5">
<Toggle bind:checked={$settings.security.hardwareAuthentication} />
</div>
</div>
Expand Down

0 comments on commit f964287

Please sign in to comment.