diff --git a/ng-app/src/App.svelte b/ng-app/src/App.svelte index 258fde6..a5fe28c 100644 --- a/ng-app/src/App.svelte +++ b/ng-app/src/App.svelte @@ -269,6 +269,9 @@ unsubscribe(); if (unsub_main_close) unsub_main_close(); }); + + // import { to_debug } from "./wallet_emojis"; + // to_debug(); {#if for_import}
- Do you trust this device?
+ {$t("pages.login.trust_device")}

- If you do, if this device is yours or is used by few trusted persons - of your family or workplace, and you would like to login again from - this device in the future, then you can save your wallet on this - device. To the contrary, if this device is public and shared by - strangers, do not save your wallet here. {#if !tauri_platform}By - selecting this option, you agree to saving some cookies on your - browser.{/if}
+ {$t("pages.login.trust_device_description")} + {#if !tauri_platform} + {$t("pages.login.trust_device_allow_cookies")}{/if}

Yes, save my wallet on this device{$t("pages.login.trust_device_yes")}
@@ -407,7 +391,7 @@
{#if !loaded} - Loading pazzle... + {$t("pages.login.loading_pazzle")}... - Open with Pazzle! + {$t("pages.login.open_with_pazzle")} {/if} {$t("pages.login.login_cancel")} - Open with Mnemonic instead + {$t("pages.login.open_with_mnemonic")}
@@ -479,7 +463,7 @@ {$t("pages.login.enter_mnemonic")} Confirm{$t("buttons.confirm")} {:else if step == "pazzle"}

- - Select your emoji of category:
{emoji_cat[ - shuffle.category_indices[pazzlePage] - ]}

{#each [0, 1, 2, 3, 4] as row} @@ -517,6 +505,7 @@ role="button" tabindex="0" class="w-full aspect-square emoji focus:outline-none focus:bg-gray-300" + title={$t("emojis.codes." + emoji.code)} on:click={() => select(row * 3 + i)} on:keypress={() => select(row * 3 + i)} > @@ -527,7 +516,7 @@ {/each} {:else if step == "order"}

- Select each image in the correct order + {$t("pages.login.order_emojis")}

{#each [0, 1, 2] as row}
@@ -539,6 +528,10 @@ class="w-full aspect-square emoji focus:outline-none focus:bg-gray-300" on:click={() => select_order(emoji)} on:keypress={() => select_order(emoji)} + title={$t( + "emojis.codes." + + emojis[emoji_cat[emoji.cat]][emoji.index].code + )} > - Enter your PIN code + {$t("pages.login.enter_pin")}

@@ -138,7 +138,7 @@ class="w-7 h-7 text-black transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white" />
- Download Wallet File + {$t("pages.wallet_info.download")} {:else if download_error}
  • Download failed:
    {download_error}
    {$t("pages.wallet_info.download_failed", { + values: { error: download_error }, + })}
  • {:else if !wallet_file_ready} @@ -166,7 +168,9 @@ class="w-7 h-7 text-blue-700 transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white" /> - Download in progress... + {$t("pages.wallet_info.download_in_progress")} {:else if download_link === true}
  • You will find the file named "{wallet_file_ready}"
    in - your Downloads folder
    {@html $t("pages.wallet_info.download_successful", { + values: { wallet_file: wallet_file_ready }, + })}
  • {:else} @@ -198,7 +203,7 @@ class="w-14 h-14 transition duration-75 dark:text-white dark:group-hover:text-white" /> - Click here to download the wallet file + {$t("pages.wallet_info.download_file_button")} @@ -218,7 +223,7 @@ class="w-7 h-7 text-black transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white" /> - Remove Wallet from Device + {$t("pages.wallet_info.remove_wallet")}

    - Are you sure you want to remove this wallet from your device? + {$t("pages.wallet_info.remove_confirm")}

    - +
    @@ -254,10 +259,13 @@ class="w-7 h-7 text-black transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white" /> - Wallet QR-Code + {$t("qr_code")} - Use this QR-Code to log in with your wallet on new devices. + {@html $t("pages.wallet_info.qr_modal_description")} {/if} @@ -274,7 +282,7 @@ class="w-7 h-7 text-black transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white" /> - Copy Wallet Link + {$t("pages.login.copy_wallet_link")} {/if} @@ -290,7 +298,7 @@ tabindex="-1" class="w-7 h-7 text-black transition duration-75 dark:text-white group-hover:text-gray-900 dark:group-hover:text-white" /> - Save to Device for Future Logins + {$t("pages.login.keep_wallet")} {/if} @@ -316,27 +324,26 @@ {#if error == "AlreadyExists"}

    - The user is already registered with the selected broker.
    Try logging - in instead + {@html $t("errors.AlreadyExists")}

    {:else}

    - An error occurred:
    {error} + {@html $t("errors.error_occurred", { values: { error } })}

    {/if} diff --git a/ng-app/src/wallet_emojis.ts b/ng-app/src/wallet_emojis.ts index d9e2e19..81363c7 100644 --- a/ng-app/src/wallet_emojis.ts +++ b/ng-app/src/wallet_emojis.ts @@ -7,6 +7,13 @@ // notice may not be copied, modified, or distributed except // according to those terms. +export type Emoji = { + hexcode: string; + shortcode: string; + code: string; + svg?: any; +}; + let face = [ { hexcode: "1f600", @@ -1709,7 +1716,7 @@ export async function load_svg() { }); } -export const emojis = { +export const emojis: Record = { face, face_unwell, face_costume, @@ -1765,3 +1772,58 @@ export function emojis_from_pazzle_ids(pazzle: number[]) { return { cat: cat_name, ...emojis[cat_name][idx] }; }); } + +/* +import en_annotations from "./locales/en_annotations.json"; +import de_annotations from "./locales/de_annotations.json"; +import fr_annotations from "./locales/fr_annotations.json"; +import ru_annotations from "./locales/ru_annotations.json"; +import es_annotations from "./locales/es_annotations.json"; +import it_annotations from "./locales/it_annotations.json"; +import zh_annotations from "./locales/zh_annotations.json"; +import pt_annotations from "./locales/pt_annotations.json"; + +function i18n_for_emoji(annotations, emoji: Emoji) { + const char = String.fromCodePoint(Number.parseInt(emoji.hexcode, 16)); + return annotations.annotations.annotations[char]?.tts[0]; +} + +function match_codes(annotations, emojis: Record) { + const not_found = []; + const map: Record = {}; + for (const cat in emojis) { + for (const emoji of emojis[cat]) { + const name = i18n_for_emoji(annotations, emoji); + if (!name) { + not_found.push(emoji); + } else { + map[emoji.code] = name; + } + } + } + if (not_found.length > 0) { + console.log("Not found: ", not_found); + } + return map; +} + +export function to_debug() { + const en = match_codes(en_annotations, emojis); + const de = match_codes(de_annotations, emojis); + const fr = match_codes(fr_annotations, emojis); + const ru = match_codes(ru_annotations, emojis); + const es = match_codes(es_annotations, emojis); + const it = match_codes(it_annotations, emojis); + const zh = match_codes(zh_annotations, emojis); + const pt = match_codes(pt_annotations, emojis); + + console.debug("en", JSON.stringify(en)); + console.debug("de", JSON.stringify(de)); + console.debug("fr", JSON.stringify(fr)); + console.debug("ru", JSON.stringify(ru)); + console.debug("es", JSON.stringify(es)); + console.debug("it", JSON.stringify(it)); + console.debug("zh", JSON.stringify(zh)); + console.debug("pt", JSON.stringify(pt)); +} +*/