fix translation

pull/28/head
Niko PLP 6 months ago
parent df5af0fe26
commit f4675ac042
  1. 7
      ng-app/src/App.svelte
  2. 5
      ng-app/src/lib/CenteredLayout.svelte
  3. 6
      ng-app/src/lib/Login.svelte
  4. 163
      ng-app/src/locales/en.json
  5. 23
      ng-app/src/locales/i18n-init.ts
  6. 2
      ng-app/src/routes/AccountInfo.svelte
  7. 24
      ng-app/src/routes/WalletCreate.svelte
  8. 2
      ng-app/src/routes/WalletInfo.svelte
  9. 23
      ng-app/src/store.ts
  10. 2
      ngone/web/src/routes/WalletCreate.svelte
  11. 3688
      pnpm-lock.yaml

@ -11,7 +11,6 @@
<script lang="ts">
import { push, default as Router } from "svelte-spa-router";
import "./locales/i18n-init";
import { isLoading } from "svelte-i18n";
import { onMount, tick, onDestroy } from "svelte";
@ -49,7 +48,7 @@
routes.set("/user", User);
routes.set("/user/registered", UserRegistered);
routes.set("/wallet", WalletInfo);
routes.set("/user/account", AccountInfo);
routes.set("/user/accounts", AccountInfo);
if (import.meta.env.NG_APP_WEB) routes.set("/install", Install);
routes.set(/^\/did:ng(.*)/i, NURI);
routes.set("*", NotFound);
@ -283,7 +282,9 @@
</p> -->
{#if $isLoading}
<p>Loading...</p>
<p class="text-center">Loading translations...</p>
{:else}
<Router {routes} />
{/if}

@ -12,10 +12,9 @@
<script lang="ts">
import ng from "../api";
import { onMount, tick } from "svelte";
import { locale } from "svelte-i18n";
import { available_languages } from "../locales/i18n-init";
import { locale, t } from "svelte-i18n";
import { available_languages } from "../store";
import { Language } from "svelte-heros-v2";
import { t } from "svelte-i18n";
export let displayFooter = false;

@ -374,9 +374,9 @@
<!-- Save wallet? -->
{#if for_import}
<div class="max-w-xl lg:px-8 mx-auto px-4 mb-2">
<span class="text-xl">{$t("pages.login.trust_device")} </span> <br />
<span class="text-xl">{$t("pages.wallet_create.save_wallet_options.trust")} </span> <br />
<p class="text-sm">
{$t("pages.login.trust_device_description")}
{$t("pages.wallet_create.save_wallet_options.trust_description")}
{#if !tauri_platform}
{$t("pages.login.trust_device_allow_cookies")}{/if}<br />
</p>
@ -467,7 +467,7 @@
>
<PasswordInput
id="mnemonic-input"
placeholder="12 words separated by spaces"
placeholder={$t("pages.login.mnemonic_placeholder")}
bind:value={mnemonic}
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
auto_complete="mnemonic"

@ -74,15 +74,13 @@
"3": "Once you completed the last category, you will be presented with all the images you have previously selected. Their order is displayed as it was when you picked them. But this is not the correct order of the images in your pazzle. You now have to order them correctly.",
"4": "You must remember which image should be the first one in your pazzle. Find it on the screen and click or tap on it. It will be greyed out and the number 1 will appear on top of it.",
"5": "Move on to the second image of your pazzle (that you memorized). Find it on the screen and tap on it. Repeat this step until you reached the last image.",
"6": "Finally, your are asked for your PIN code. Enter it by clicking or tapping on the digits."
"6": "Finally, you are asked for your PIN code. Enter it by clicking or tapping on the digits."
},
"with_mnemonic": "With your 12 words Mnemonic (passphrase)",
"mnemonic_steps": {
"1": "Enter your twelve words mnemonic in the input field. The words must be separated by spaces.",
"2": "Enter the PIN code that you chose when you created your wallet."
},
"trust_device": "Do you trust this device?",
"trust_device_description": "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.",
"trust_device_allow_cookies": "By selecting this option, you agree to saving some cookies on your browser.",
"trust_device_yes": "Yes, save my wallet on this device",
"loading_pazzle": "Loading Pazzle",
@ -90,19 +88,20 @@
"login_cancel": "Cancel Login",
"open_with_mnemonic": "Open with Mnemonic instead",
"enter_mnemonic": "Enter your 12 words mnemonic.",
"select_emoji": "Select your emoji of category:<br />{category}",
"mnemonic_placeholder": "12 words separated by spaces",
"select_emoji": "Select your image for category:<br />{category}",
"order_emojis": "Select each image in the correct order",
"enter_pin": "Enter your PIN code",
"opening_wallet": "Opening your wallet...<br /> Please wait",
"wallet_opened": "Your wallet is opened! <br />Please wait while the app is loading...",
"qr_code": "Wallet QR-Code",
"qr_modal_title": "My Wallet QR-Code",
"qr_modal_description": "Use this QR-Code to log in with your wallet on new devices.",
"qr_code": "Wallet QRCode",
"qr_modal_title": "My Wallet QRCode",
"qr_modal_description": "Use this QRCode to log in with your wallet on new devices.",
"copy_wallet_link": "Copy Wallet Link",
"keep_wallet": "Save to Device for Future Logins"
},
"account_info": {
"title": "Account Info",
"title": "Accounts Info",
"site": "{name} account",
"devices": "Devices",
"brokers": "Brokers",
@ -144,7 +143,7 @@
},
"choose_broker": "Please choose one broker among the list",
"register_with_broker": "Register with {broker}",
"for_eu_citizens": "For European Union Citizens",
"for_eu_citizens": "European Union Citizens",
"for_rest": "For the rest of the world",
"enter_invite_link": "Enter an invitation link",
"scan_invite_qr": "Scan an invitation QR-code",
@ -179,6 +178,7 @@
"9": "The best would be a landscape you like or any other picture that you will recognize as unique.",
"10": "Please be aware that other people who are sharing this device with you, will be able to see this image and phrase."
},
"type_security_phrase_placeholder": "Type a security phrase...",
"save_security_phrase_and_image": "Save security phrase & image",
"tap_to_upload": "Tap to upload an image",
"click_to_upload": "Click to select an image",
@ -189,7 +189,6 @@
"description": "There are 4 options to choose before we can create your wallet. Those options can help you to use and keep your wallet. But we also want to be careful with your security and privacy.<br /><br /> Remember that in any case, once your wallet will be created, you will download a file that you should keep privately somewhere on your device, USB key or hard-disk. This is the default way you can use and keep your wallet. Now let's look at some options that can make your life a bit easier.",
"trust": "Do you trust this device?",
"trust_description": "If you do, if this device is yours, or it is used by a 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.",
"trust_allow_cookies": "By selecting this option, you agree to saving some cookies on your browser.",
"trust_toggle": "Save my wallet on this device?",
"cloud": "Keep a copy in the cloud?",
"cloud_description": "Are you afraid that you will loose the file containing your wallet? If this would happen, your wallet would be lost forever, together with all your documents. We can keep an encrypted copy of your wallet in our cloud. Only you will be able to download it with a special link. You would have to keep this link safely though. By selecting this option, you agree to the",
@ -212,7 +211,7 @@
"your_mnemonic": "And here is your mnemonic (your alternative passphrase):",
"unlock_tips_1": "You can use both the pazzle or the mnemonic to unlock your wallet. The pazzle is easier to remember. The mnemonic is useful in some special cases. We recommend that you use the pazzle. <span class=\"font-bold text-xl\" >Copy both on a piece of paper.</span > You should try to memorize the pazzle. Once you did, you won't need the paper anymore.",
"unlock_tips_2": "Now click on \"Continue to Login\" and select your new wallet.",
"unlock_tips_3": "It is important that you <span class=\"font-bold\">login</span> with this wallet <span class=\"font-bold\">at least once</span> from this {platform, select, browser {browser tab} other {device}},<br /> while connected to the internet, so your personal site can be created on your broker.",
"unlock_tips_3": "It is important that you <span class=\"font-bold\">login</span> with this wallet <span class=\"font-bold\">at least once</span> from this {platform, select, browser {browser tab} other {device}}, while connected to the internet, so your personal site can be created on your broker.",
"continue_to_login": "Continue to Login",
"continue_confirm": "Did you write down your login credentials?",
"continue_confirm_description": "The pazzle and the mnemonic <span class=\"font-bold\"> will not be shown to you again</span >. Please make sure, you have written them down.",
@ -224,34 +223,34 @@
"with_another_wallet": "Log in with another wallet",
"import_wallet": "Import your wallet",
"import_file": "Import a Wallet File",
"import_qr": "Import with QR-Code",
"import_qr": "Import with QRCode",
"import_link": "Enter a Wallet Link",
"new_wallet": "Create a New Wallet",
"new_wallet": "Create a new Wallet",
"logged_in": "You are logged in.<br /> please wait while the app is loading"
}
},
"buttons": {
"ok": "Ok",
"go_back": "Go Back",
"go_back": "Go back",
"back": "Back",
"confirm": "Confirm",
"cancel": "Cancel",
"remove": "Remove",
"correct": "Correct",
"try_again": "Try Again",
"back_to_homepage": "Go Back to Homepage",
"try_again": "Try again",
"back_to_homepage": "Go back to Homepage",
"logout": "Logout",
"login": "Login",
"start_over": "Start over"
},
"errors": {
"an_error_occurred": "An error occurred!",
"an_error_occurred": "An error occurred",
"error_occurred": "An error occurred:<br />{message}",
"AlreadyExists": "The user is already registered with the selected broker.<br />Try logging in instead.",
"InvalidSignature": "The signature is invalid.",
"IncompleteSignature": "The signature is incomplete.",
"SerializationError": "The object could not be serialized.",
"EncryptionError": "Error with encryption.",
"EncryptionError": "Your wallet could not be opened. You probably did a mistake.",
"DecryptionError": "Error with decryption.",
"InvalidValue": "The value is invalid.",
"ConnectionNotFound": "The connection was not found.",
@ -265,15 +264,15 @@
"InvalidMnemonic": "The mnemonic is not correct.",
"CommitLoadError": "Error loading commit.",
"ObjectParseError": "Error parsing object.",
"StorageError": "Storage error. ",
"NotFound": "Could not find resource.",
"StorageError": "Storage error.",
"NotFound": "Not Found",
"JsStorageKeyNotFound": "Could not find JavaScript storage key.",
"IoError": "Input/Output error.",
"CommitVerifyError": "Verifying commit failed.",
"LocalBrokerNotInitialized": "The local broker is not initialized.",
"JsStorageReadError": "Could not read from JavaScript Storage.",
"JsStorageWriteError": "Could not write to JavaScript Storage.",
"CannotSaveWhenInMemoryConfig": "Saving in Browser is not possible.",
"CannotSaveWhenInMemoryConfig": "Saving while configured for In-Memory is not possible.",
"WalletNotFound": "The wallet was not found.",
"WalletAlreadyAdded": "The wallet is already added.",
"WalletAlreadyOpened": "The wallet is already open.",
@ -336,23 +335,23 @@
"sport": "Sport",
"bigger_animal": "Big Animal",
"smaller_animal": "Small Animal",
"plants": "Plants and Instects",
"fruits": "Fruites and Veggies",
"plants": "Plants and Insects",
"fruits": "Fruits and Veggies",
"food": "Food and Drinks",
"travel": "Travel",
"sky": "Sky and Weather",
"play": "Leasure",
"play": "Leisure",
"house": "Household"
},
"codes": {
"COMMENT": "YOU CAN FIND I18N UNICODE DESCRIPTIONS AT https://github.com/unicode-org/cldr-json",
"happy": "happy grinning face",
"happy": "happy face",
"happy_tears": "face with tears of joy",
"halo": "smiling face with halo ring",
"three_hearts": "face with 3 hearts",
"with_two_hearts": "face with 2 heart-eyes",
"one_heart": "face blowing one heart kiss",
"with_tongue": "squinting face with tongue",
"with_tongue": "face with tongue",
"with_two_hands": "face with two hands",
"one_hand": "face with hand over mouth",
"silenced": "silenced zipper-mouth face",
@ -374,12 +373,12 @@
"long_nose": "long nose lying face",
"many_tears": "loudly crying face",
"fear": "face screaming in fear",
"tired": "yawning face",
"tired": "tired yawning face",
"annoyed": "annoyed face with steam from nose",
"clown": "clown face",
"ghost": "ghost",
"dog": "dog face",
"happy_cat": "grinning cat with smiling eyes",
"happy_cat": "happy cat with smiling eyes",
"scared_cat": "weary scared cat",
"sad_cat": "crying cat",
"monkey_no_see": "see-no-evil monkey",
@ -389,24 +388,24 @@
"princess": "princess",
"firefighter": "firefighter",
"mage": "mage",
"mermaid": "merperson",
"mermaid": "mermaid",
"fairy": "fairy",
"letter_heart": "love letter",
"red_heart": "red heart",
"two_hearts": "two hearts",
"kiss": "kiss mark",
"hundred": "hundred points",
"explosion": "collision",
"explosion": "explosion",
"drops": "sweat droplets",
"handshake": "handshake",
"hand_five_fingers": "hand with fingers splayed",
"hand_two_fingers": "victory hand",
"hand_five_fingers": "hand with 5 fingers splayed",
"hand_two_fingers": "victory hand with 2 fingers",
"thumbs_up": "thumbs up",
"fist": "raised fist",
"two_hands": "open hands",
"two_hands": "two open hands",
"writing": "writing hand",
"praying": "folded hands",
"arm": "flexed biceps",
"praying": "praying folded hands",
"arm": "flexed arm",
"leg": "leg",
"foot": "foot",
"ear": "ear",
@ -418,24 +417,24 @@
"tongue": "tongue",
"mouth": "mouth",
"shirt": "t-shirt",
"pants": "jeans",
"pants": "pants",
"dress": "dress",
"shoe": "running shoe",
"fencing": "person fencing",
"horse_riding": "horse racing",
"fencing": "fencing",
"horse_riding": "horse riding",
"ski": "skier",
"rowing_boat": "person rowing boat",
"swim": "person swimming",
"surf": "person surfing",
"gym": "person lifting weights",
"wrestling": "people wrestling",
"bike": "person biking",
"rowing_boat": "rowing boat",
"swim": "swimming",
"surf": "surfing",
"gym": "lifting weights",
"wrestling": "two people wrestling",
"bike": "biking",
"parachute": "parachute",
"football": "soccer ball",
"football": "football",
"basketball": "basketball",
"tennis": "tennis",
"ping_pong": "ping pong",
"martial": "martial arts uniform",
"martial": "judo uniform kimono",
"lion": "lion",
"leopard": "leopard",
"horse": "horse face",
@ -448,7 +447,7 @@
"elephant": "elephant",
"rhinoceros": "rhinoceros",
"flamingo": "flamingo",
"whale": "spouting whale",
"whale": "whale",
"dolphin": "dolphin",
"bear": "bear",
"rooster": "rooster",
@ -464,22 +463,22 @@
"hedgehog": "hedgehog",
"bat": "bat",
"fish": "fish",
"shell": "spiral shell",
"shell": "shell",
"octopus": "octopus",
"snail": "snail",
"butterfly": "butterfly",
"ant": "ant",
"bee": "honeybee",
"beetle": "lady beetle",
"beetle": "beetle",
"rose": "rose",
"sunflower": "sunflower",
"fir": "evergreen tree",
"fir": "evergreen fir tree",
"palm_tree": "palm tree",
"cactus": "cactus",
"clover": "four leaf clover",
"potted_plant": "potted plant",
"bouquet": "bouquet",
"three_leaves": "fallen leaf",
"three_leaves": "three fallen leaf",
"mushroom": "mushroom",
"grapes": "grapes",
"watermelon": "watermelon",
@ -489,37 +488,37 @@
"apple": "red apple",
"cherries": "cherries",
"strawberry": "strawberry",
"three_blueberries": "blueberries",
"kiwi": "kiwi fruit",
"three_blueberries": "three blueberries",
"kiwi": "kiwi",
"avocado": "avocado",
"eggplant": "eggplant",
"carrot": "carrot",
"corn": "ear of corn",
"pepper": "hot pepper",
"corn": "corn",
"pepper": "red hot pepper",
"croissant": "croissant",
"bread": "baguette bread",
"pretzel": "pretzel",
"cheese": "cheese wedge",
"pizza": "pizza",
"egg": "cooking",
"ice_cream": "soft ice cream",
"cheese": "cheese",
"pizza": "slice of pizza",
"egg": "fried egg",
"ice_cream": "ice cream",
"cookie": "cookie",
"cake": "shortcake",
"chocolate": "chocolate bar",
"cake": "piece of cake",
"chocolate": "chocolate",
"sweet": "candy",
"coffee": "hot beverage",
"champagne_bottle": "bottle with popping cork",
"coffee": "coffee",
"champagne_bottle": "champagne bottle",
"glass_wine": "wine glass",
"two_glasses": "clinking glasses",
"mountain": "snow-capped mountain",
"two_glasses": "two glasses of cava",
"mountain": "smountain",
"camping": "camping",
"beach": "beach with umbrella",
"beach": "beach",
"compass": "compass",
"museum": "classical building",
"house": "house with garden",
"museum": "museum",
"house": "house",
"fountain": "fountain",
"circus": "circus tent",
"train": "locomotive",
"circus": "circus",
"train": "train",
"taxi": "taxi",
"motorcycle": "motorcycle",
"sailboat": "sailboat",
@ -527,15 +526,15 @@
"helicopter": "helicopter",
"rocket": "rocket",
"sun": "sun",
"moon": "crescent moon",
"planet": "ringed planet",
"moon": "moon",
"planet": "planet",
"star": "star",
"night_sky": "milky way",
"night_sky": "night sky",
"cloud": "cloud with rain",
"umbrella": "umbrella with rain drops",
"lightning": "lightning",
"snowflake": "snowflake",
"snowman": "snowman without snow",
"snowman": "snowman",
"thermometer": "thermometer",
"fire": "fire",
"balloon": "balloon",
@ -544,29 +543,29 @@
"guitar": "guitar",
"saxophone": "saxophone",
"music": "musical note",
"painting": "artist palette",
"chess": "chess pawn",
"gift": "wrapped gift",
"painting": "painting",
"chess": "chess",
"gift": "gift",
"die": "game die",
"puzzle": "puzzle piece",
"puzzle": "puzzle",
"teddy_bear": "teddy bear",
"firecracker": "firecracker",
"bullseye": "bullseye",
"roller_skate": "roller skate",
"kick_scooter": "kick scooter",
"anchor": "anchor",
"scuba_diving": "diving mask",
"scuba_diving": "scuba diving",
"broom": "broom",
"magnifying_glass": "magnifying glass tilted left",
"magnifying_glass": "magnifying glass",
"bulb": "light bulb",
"three_books": "three books",
"package": "package",
"pencil": "pencil",
"pin": "pushpin",
"pin": "pin",
"paperclip": "paperclip",
"scissors": "scissors",
"key": "key",
"lock": "unlocked",
"lock": "lock",
"chair": "chair",
"bathtub": "bathtub",
"sponge": "sponge",

@ -1,23 +0,0 @@
import { register, init, getLocaleFromNavigator } from "svelte-i18n";
// Make sure that a file with `<lang>.json` exists
// in the same directory, when adding it here.
export const available_languages = {
en: "English",
de: "Deutsch",
fr: "Français",
ru: "Русский",
es: "Español",
it: "Italiano",
zh: "中文",
pt: "Português",
};
for (const lang of Object.keys(available_languages)) {
register(lang, () => import(`./${lang}.json`))
}
init({
fallbackLocale: "en",
initialLocale: getLocaleFromNavigator(),
});

@ -11,7 +11,7 @@
<!--
@component
"Account Info" user panel sub menu.
"Accounts Info" user panel sub menu.
Provides info about wallet, broker, etc. and download option.
-->

@ -1325,7 +1325,7 @@
bind:this={phrase}
class="mt-10 mr-0"
id="security-phrase-input"
placeholder="Type a security phrase..."
placeholder={$t("pages.wallet_create.type_security_phrase_placeholder")}
bind:value={security_txt}
on:keypress={security_phrase_ok}
/><button on:click={async () => await security_phrase_ok()}>
@ -1375,7 +1375,7 @@
{:else}
<span class="font-semibold"
>{$t("pages.wallet_create.click_to_upload")}</span
>{$t("pages.wallet_create.or_drag_drop")}
> {$t("pages.wallet_create.or_drag_drop")}
{/if}
</p>
<svg
@ -1433,9 +1433,9 @@
"pages.wallet_create.save_wallet_options.trust_description"
)}
{#if !tauri_platform}{@html $t(
"pages.wallet_create.save_wallet_options.trust_allow_cookies"
)}{/if}<br />
<Toggle class="mt-3" bind:checked={options.trusted}
"pages.login.trust_device_allow_cookies"
)}{/if}<br /><br />
<Toggle bind:checked={options.trusted}
>{@html $t(
"pages.wallet_create.save_wallet_options.trust_toggle"
)}</Toggle
@ -1460,8 +1460,8 @@
"pages.wallet_create.save_wallet_options.cloud_tos"
)}</span
>.
<br />
<Toggle disabled class="mt-3" bind:checked={options.cloud}
<br /><br />
<Toggle disabled bind:checked={options.cloud}
>{@html $t(
"pages.wallet_create.save_wallet_options.cloud_toggle"
)}</Toggle
@ -1475,8 +1475,8 @@
{@html $t(
"pages.wallet_create.save_wallet_options.pdf_description"
)}
<br />
<Toggle disabled class="mt-3" bind:checked={options.pdf}
<br /><br />
<Toggle disabled bind:checked={options.pdf}
>{@html $t(
"pages.wallet_create.save_wallet_options.pdf_toggle"
)}</Toggle
@ -1500,8 +1500,8 @@
"pages.wallet_create.save_wallet_options.cloud_tos"
)}</span
>.
<br />
<Toggle disabled class="mt-3" bind:checked={options.bootstrap}
<br /><br />
<Toggle disabled bind:checked={options.bootstrap}
>{@html $t(
"pages.wallet_create.save_wallet_options.link_toggle"
)}</Toggle
@ -1645,7 +1645,7 @@
</div>
<div class="flex flex-col ml-4">
<div class="w-[10em] text-left">
<span>{emoji.cat}</span>
<span>{$t("emojis.category." + emoji.cat)}</span>
</div>
<div class="font-bold text-lg h-full content-center">
<span>{$t("emojis.codes." + emoji.code)}</span>

@ -246,7 +246,7 @@
</div>
</Modal>
<!-- TODO: Show QR-Code -->
<!-- TODO: Show QRCode -->
{#if false}
<li
tabindex="0"

@ -15,14 +15,33 @@ import {
get,
type Writable,
} from "svelte/store";
import { locale } from "svelte-i18n";
import { register, init, locale } from "svelte-i18n";
import ng from "./api";
import { official_classes } from "./classes";
import { official_apps, official_services } from "./zeras";
import { available_languages } from "./locales/i18n-init";
let all_branches = {};
// Make sure that a file named `locales/<lang>.json` exists when adding it here.
export const available_languages = {
en: "English",
de: "Deutsch",
fr: "Français",
ru: "Русский",
es: "Español",
it: "Italiano",
zh: "中文",
pt: "Português",
};
for (const lang of Object.keys(available_languages)) {
register(lang, () => import(`./locales/${lang}.json`))
}
init({
fallbackLocale: "en",
initialLocale: "en",
});
export const select_default_lang = async () => {
let locales = await ng.locales();

@ -73,7 +73,7 @@
class="text-primary-700 bg-primary-100 hover:bg-primary-100/90 focus:ring-4 focus:ring-primary-100/50 font-medium rounded-lg text-lg px-5 py-2.5 text-center inline-flex items-center dark:focus:ring-primary-100/55 mr-2 mb-2"
>
<EULogo class="mr-4 block h-10 w-10" alt="European Union flag" />
For European Union citizens
European Union citizens
</button>
</a>
</div>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save