Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: add all missing meassages keys #140

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,35 @@
"Claim_credential": "Claim credential",
"Wallet": "Wallet",
"Scan_QR_code_to_claim_credential_or_request_one_below": "Scan QR code to claim credential or request one below",
"Language": "Language"
"Language": "Language",
"Login": "Login",
"Login_with_your_personal_questions_Tap_here": "Login with your personal questions? Tap here",
"Where_did_your_parents_meet": "",
"What_is_the_name_of_your_first_pet": "What is the name of your first pet?",
"What_is_your_home_town": "What is your home town?",
"What_is_the_name_of_your_first_teacher": "What is the name of your first teacher?",
"What_is_the_surname_of_your_mother_before_wedding": "What is the surname of your mother before wedding?",
"Login_with_your_passphrase_Tap_here": "Login with your passphrase? Tap here",
"Keypair_creation_successful": "Keypair creation successful!",
"Please_store_this_in_a_safe_place_to_recover_your_account_in_the_future_this_passphrase_will_be_shown_only_one_time": "Please store this in a safe place to recover your account in the future, this passphrase will be shown only one\n\t\t\t\ttime!",
"Copy_seed": "Copy seed",
"Go_to_wallet": "Go to wallet",
"Recent_Conversations": "Recent Conversations",
"Badges": "Badges:",
"Public_Key": "Public Key:",
"Logout": "Logout",
"Verify": "Verify",
"My_issued_credentials": "My issued credentials",
"Explore_and_manage_your_verified_credentials": "Explore and manage your verified credentials",
"Home": "Home",
"Notifications": "Notifications",
"Profile": "Profile'",
"Results": "Results",
"Close": "Close",
"QR_SCAN": "QR SCAN",
"Scan_QR_to_verify_or_obtain_credentials_": "Scan QR to verify or obtain credentials...",
"Make_sure_to_scan_the_full_QR_surface_": "Make sure to scan the full QR surface...",
"Copied": "Copied!",
"Submit": "Submit",
"Add_an_item": "Add an item"
}
3 changes: 2 additions & 1 deletion src/lib/JSONSchemaForms/JSONSchemaForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { Form, FormError } from '$lib/forms';
import ErrorDisplay from '$lib/components/errorDisplay.svelte';
import { objectSchemaToSuperformsValidators } from './errors';
import { m } from '$lib/i18n';

//

Expand Down Expand Up @@ -52,7 +53,7 @@

<div class="flex justify-end">
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-static-element-interactions -->
<ion-button type="submit"> Submit </ion-button>
<ion-button type="submit">{m.Submit()}</ion-button>
</div>
</div>
</Form>
5 changes: 3 additions & 2 deletions src/lib/JSONSchemaForms/JSONSchemaFormField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import type { SuperformGeneric } from '$lib/forms/types';
import IonItemWrapper from './fieldWrappers/ionItemWrapper.svelte';
import SlotWrapper from './fieldWrappers/slotWrapper.svelte';
import { m } from '$lib/i18n';

export let form: SuperformGeneric;
export let fieldPath: string;
Expand Down Expand Up @@ -181,7 +182,7 @@
schema={schema.items}
hideLabel
{required}
inputAttributes={{ placeholder: 'Add an item', ['label-placement']: 'stacked', class: 'grow' }}
inputAttributes={{ placeholder: m.Add_an_item(), ['label-placement']: 'stacked', class: 'grow' }}
fieldWrapper={SlotWrapper}
/>
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-static-element-interactions -->
Expand All @@ -196,7 +197,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-static-element-interactions -->
<ion-button class="grow" expand="full" shape="round" color="light" disabled={!canAdd} on:click={addItem}>
<ion-icon slot="start" icon={addOutline} />
Add an item
{m.Add_an_item()}
</ion-button>
</ion-item>
{/if}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/copyButton.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import { Clipboard } from '@capacitor/clipboard';
import { m } from '$lib/i18n';

export let textToCopy: string;
export let delay = 2000;
Expand All @@ -26,6 +27,6 @@
<slot />
</span>
{:else}
<span class="whitespace-nowrap">✅ Copied!</span>
<span class="whitespace-nowrap">✅ {m.Copied()}</span>
{/if}
</ion-button>
22 changes: 13 additions & 9 deletions src/lib/components/molecules/Modal.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<script lang="ts">
import { fly } from 'svelte/transition';
export let isModalOpen: boolean
export let closeCb: () => void
const closeModal = () => {
import { m } from '$lib/i18n';

export let isModalOpen: boolean;
export let closeCb: () => void;
const closeModal = () => {
isModalOpen = false;
closeCb();
}
};
</script>

<ion-modal
Expand All @@ -19,13 +21,15 @@
<hr />
<ion-content class="ion-padding visible">
<ion-toolbar>
<ion-title>Results</ion-title>
<ion-title>{m.Results()}</ion-title>
<ion-buttons slot="end">
<ion-button color="danger" on:click={closeModal} on:keydown={closeModal} aria-hidden>Close</ion-button>
<ion-button color="danger" on:click={closeModal} on:keydown={closeModal} aria-hidden
>{m.Close()}</ion-button
>
</ion-buttons>
</ion-toolbar>
<div class="mt-4 flex flex-col gap-2">
<slot/>
</div>
<div class="mt-4 flex flex-col gap-2">
<slot />
</div>
</ion-content>
</ion-modal>
4 changes: 2 additions & 2 deletions src/lib/components/molecules/ScanButton.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { r } from '$lib/i18n';
import { qrCode } from 'ionicons/icons';
import { qrCode } from 'ionicons/icons';
</script>

<ion-fab-button href={r("/scan")}>
<ion-fab-button href={r('/scan')}>
<ion-icon icon={qrCode} translucent />
</ion-fab-button>

Expand Down
Empty file.
7 changes: 4 additions & 3 deletions src/lib/components/organisms/scanner/Scanner.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { BarcodeScanner, type Barcode } from '@capacitor-mlkit/barcode-scanning';
import { close } from 'ionicons/icons';
import { createEventDispatcher, onMount } from 'svelte';
import { m } from '$lib/i18n';

const dispatch = createEventDispatcher();
const qrCodeScanned = (barcode: Barcode) => {
Expand Down Expand Up @@ -55,7 +56,7 @@
<ion-header class="visible bg-[#d2d7e5]">
<ion-toolbar>
<div class="flex flex-row">
<ion-title>QR SCAN</ion-title>
<ion-title>{m.QR_SCAN()}</ion-title>
<ion-button tab="account" on:click={stopScan} on:keydown={stopScan} aria-hidden fill="clear">
<ion-icon icon={close}></ion-icon>
</ion-button>
Expand All @@ -67,8 +68,8 @@
<slot {scan} {stopScan} />
<div class="visible absolute bottom-0 flex h-48 flex-col gap-2 bg-[#d2d7e5] px-4 pt-4">
<d-heading size="s">
<h2>Scan QR to verify or obtain credentials...</h2>
<h2>{m.Scan_QR_to_verify_or_obtain_credentials_()}</h2>
</d-heading>
<d-text size="l"> <p class="pb-4">Make sure to scan the full QR surface...</p></d-text>
<d-text size="l"> <p class="pb-4">{m.Make_sure_to_scan_the_full_QR_surface_()}</p></d-text>
</div>
</ion-content>
9 changes: 0 additions & 9 deletions src/lib/nativeHooks/EchoPlugin.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { createForm, FieldController, Form, FormError } from '$lib/forms';
import { setKeypairPreference } from '$lib/preferences/keypair.js';
import { unlockApp } from '$lib/preferences/locked.js';
import { m } from '$lib/i18n';

//

Expand Down Expand Up @@ -56,14 +57,14 @@
</FormError>

<div class="flex justify-end">
<ion-button role="button" type="submit" tabindex={0}>Login</ion-button>
<ion-button role="button" type="submit" tabindex={0}>{m.Login()}</ion-button>
</div>

<hr />

<div>
<ion-text color="secondary">
<a href={r("/login/questions")} class="text-sm">Login with your personal questions? Tap here</a>
<a href={r("/login/questions")} class="text-sm">{m.Login_with_your_personal_questions_Tap_here()}</a>
</ion-text>
</div>
</div>
Expand Down
25 changes: 12 additions & 13 deletions src/routes/[[lang]]/(auth)/login/(methods)/questions/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import CopyButton from '$lib/components/copyButton.svelte';
import { setKeypairPreference } from '$lib/preferences/keypair.js';
import { unlockApp } from '$lib/preferences/locked.js';
import { r } from '$lib/i18n';
import { r, m } from '$lib/i18n';

//

Expand All @@ -23,11 +23,11 @@
//

export const questions: Array<{ id: UserChallenge; text: string }> = [
{ id: C.whereParentsMet, text: 'Where did your parents meet?' },
{ id: C.nameFirstPet, text: 'What is the name of your first pet?' },
{ id: C.whereHomeTown, text: 'What is your home town?' },
{ id: C.nameFirstTeacher, text: 'What is the name of your first teacher?' },
{ id: C.nameMotherMaid, text: 'What is the surname of your mother before wedding?' }
{ id: C.whereParentsMet, text: m.Where_did_your_parents_meet() },
{ id: C.nameFirstPet, text: m.What_is_the_name_of_your_first_pet() },
{ id: C.whereHomeTown, text: m.What_is_your_home_town() },
{ id: C.nameFirstTeacher, text: m.What_is_the_name_of_your_first_teacher() },
{ id: C.nameMotherMaid, text: m.What_is_the_surname_of_your_mother_before_wedding() }
];

//
Expand Down Expand Up @@ -105,26 +105,25 @@
</FormError>

<div class="flex justify-end">
<ion-button role="button" type="submit" tabindex={0}>login</ion-button>
<ion-button role="button" type="submit" tabindex={0}>{m.Login()}</ion-button>
</div>

<hr />

<div>
<ion-text color="secondary">
<a href={r("/login/passphrase")} class="text-sm">Login with your passphrase? Tap here</a>
<a href={r("/login/passphrase")} class="text-sm">{m.Login_with_your_passphrase_Tap_here()}</a>
</ion-text>
</div>
</div>
</Form>
{:else}
<div class="space-y-6">
<h1 class="text-lg font-bold">Keypair creation successful!</h1>
<h1 class="text-lg font-bold">{m.Keypair_creation_successful()}</h1>

<div>
<ion-text>
Please store this in a safe place to recover your account in the future, this passphrase will be shown only one
time!
{m.Please_store_this_in_a_safe_place_to_recover_your_account_in_the_future_this_passphrase_will_be_shown_only_one_time()}
</ion-text>
</div>

Expand All @@ -133,10 +132,10 @@
{seed}
</div>
<div class="flex justify-end pt-4">
<CopyButton textToCopy={seed}>Copy seed</CopyButton>
<CopyButton textToCopy={seed}>{m.Copy_seed()}</CopyButton>
</div>
</div>

<ion-button href={r("/wallet")} expand="full">Go to wallet</ion-button>
<ion-button href={r("/wallet")} expand="full">{m.Go_to_wallet()}</ion-button>
</div>
{/if}
9 changes: 5 additions & 4 deletions src/routes/[[lang]]/(protected)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
//@ts-ignore
import IonTabs from 'ionic-svelte/components/IonTabs.svelte';
import { type IonTabProps, Tabs } from '$lib/tabs';
import { m } from '$lib/i18n';

//

const tabs: IonTabProps[] = [
{ label: 'Home', icon: home, tab: Tabs.home },
{ label: 'Wallet', icon: walletOutline, tab: Tabs.wallet },
{ label: 'Notifications', icon: notificationsOutline, tab: Tabs.notifications },
{ label: 'Profile', icon: personOutline, tab: Tabs.profile }
{ label: m.Home(), icon: home, tab: Tabs.home },
{ label: m.Wallet(), icon: walletOutline, tab: Tabs.wallet },
{ label: m.Notifications(), icon: notificationsOutline, tab: Tabs.notifications },
{ label: m.Profile(), icon: personOutline, tab: Tabs.profile }
];
</script>

Expand Down
3 changes: 2 additions & 1 deletion src/routes/[[lang]]/(protected)/notifications/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script lang="ts">
import TabPage from '$lib/tabs/TabPage.svelte';
import { faker } from '@faker-js/faker';
import { m } from '$lib/i18n';
</script>

<TabPage tab="notifications" title="NOTIFICATIONS">
<ion-list>
<ion-list-header>Recent Conversations</ion-list-header>
<ion-list-header>{m.Recent_Conversations()}</ion-list-header>
{#each Array(10) as _}
<ion-item>
<ion-avatar slot="start">
Expand Down
7 changes: 4 additions & 3 deletions src/routes/[[lang]]/(protected)/profile/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<script lang="ts">
import TabPage from '$lib/tabs/TabPage.svelte';
import { m } from '$lib/i18n';
</script>

<TabPage tab="profile" title="PROFILE">
<div class="flex-col gap-2">
<ion-label>Badges:</ion-label>
<ion-label>{m.Badges()}</ion-label>
<div class="mt-2 flex-row gap-2">
<ion-badge class="p-4" color="primary">Dyne.org</ion-badge>
<ion-badge class="p-4" color="secondary">Forkbomb</ion-badge>
<ion-badge class="p-4" color="tertiary">Acme</ion-badge>
</div>
<br />
<ion-label>Public Key:</ion-label>
<ion-label>{m.Public_Key()}</ion-label>
<div class="select-all rounded-md border-2 border-slate-700 bg-slate-400 p-1">
63FaC9201494f0bd17B9892B9fae4d52fe3BD377
</div>
<ion-button href="/logout">Logout</ion-button>
<ion-button href="/logout">{m.Logout()}</ion-button>
</div>
</TabPage>
37 changes: 0 additions & 37 deletions src/routes/[[lang]]/(protected)/request/+page.svelte

This file was deleted.

4 changes: 2 additions & 2 deletions src/routes/[[lang]]/(protected)/request/[id]/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import Logo from '$lib/components/atoms/Logo.svelte';
import {m} from '$lib/i18n'
import { m } from '$lib/i18n';

export let data:string
export let data: string;
</script>

<ion-header>
Expand Down
Loading
Loading