Skip to content

Commit

Permalink
i18n: translate copy
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebus-84 committed Sep 3, 2024
1 parent 3112758 commit 70fc34f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
9 changes: 7 additions & 2 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"REGISTER": "REGISTER",
"You_can_recover_your_keypair_by_answering_the_registration_questions_correctly_again": "You can recover your keyring by answering the security questions correctly again or using this passphrase.",
"SCAN_QR": "SCAN QR",
"Go_to_issuance_services": "Get credentials",
"Go_to_issuance_services": "GET CREDENTIALS",
"CREATE_AN_ACCOUNT": "CREATE AN ACCOUNT",
"LOGIN": "LOGIN",
"on_boarding_subtitle_1": "DIDroom supports multiple standards like EUDI-ARF (eIDAS 2.0), W3C-VC, W3C-DID and BBS zero-knowledge proofs.",
Expand Down Expand Up @@ -142,5 +142,10 @@
"mark_all_as_read": "mark all as read",
"Issuer": "Issuer",
"Exp": "Exp",
"ok": "ok"
"ok": "ok",
"not_public": "not public",
"John_Doe": "John_Doe",
"username": "username",
"public_email": "public email",
"save": "save"
}
24 changes: 13 additions & 11 deletions src/routes/[[lang]]/(protected)/user-settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { pocketbase } from '@slangroom/pocketbase';
import update from '$lib/slangroom/update.slang?raw';
import Checkbox from '$lib/forms/checkbox.svelte';
import { cameraOutline, cloudUploadOutline } from 'ionicons/icons';
// import { invalidate, invalidateAll } from '$app/navigation';
// import { _userSettingsKey } from './+page.js';
Expand Down Expand Up @@ -68,12 +69,10 @@
},
record_parameters: {}
};
//@ts-ignore
const res = await slangroom.execute(update, { data });
await slangroom.execute(update, { data });
// await invalidate(_userSettingsKey)
// await invalidateAll()
loading = false;
console.log(res);
} catch (error) {}
},
initialData
Expand All @@ -98,8 +97,6 @@
fr.readAsDataURL(choosenAvatarFile);
}
let name = form.fields.name?.value;
let emailVisibility = form.fields.emailVisibility;
$: console.log(data.user?.emailVisibility ? 'public' : 'not public');
</script>

<HeaderWithBackButton>User Settings</HeaderWithBackButton>
Expand All @@ -114,20 +111,25 @@
<d-vertical-stack>
<d-heading size="xs" class="w-full">{$name || user?.name}</d-heading>
<d-heading size="xs" class="w-full"
>{user?.email} ({data.user?.emailVisibility ? 'public' : 'not public'})</d-heading
>{user?.email} ({data.user?.emailVisibility ? m.public_email() : m.not_public()})</d-heading
>
</d-vertical-stack>
</d-horizontal-stack>
<hr />
<Form {form} formClass="flex flex-col gap-4 pb-6 pt-4 w-full">
<d-horizontal-stack class="w-full">
<d-button on:click={chooseImage}>photo</d-button>
<d-horizontal-stack class="w-full items-stretch" gap={0}>
<d-button on:click={chooseImage} class="pt-1"
><ion-icon icon={cloudUploadOutline} slot="icon-only" class="py-2"/></d-button
>
<d-button on:click={chooseImage} class="pt-1"
><ion-icon icon={cameraOutline} slot="icon-only" class="py-2"/></d-button
>
<d-input name="avatar" value={choosenAvatar || user?.avatar} class="w-full"></d-input>
</d-horizontal-stack>
<Checkbox {form} fieldPath="emailVisibility">public email</Checkbox>
<Input {form} fieldPath="name" placeholder={'m.John_Doe()'} label={'m.Name()'} type="text" />
<Checkbox {form} fieldPath="emailVisibility">{m.public_email()}</Checkbox>
<Input {form} fieldPath="name" placeholder={m.John_Doe()} label={m.username()} type="text" />
<d-button size="default" color="accent" type="submit" expand class="mt-4">
{'save'}
{m.save()}
</d-button>
</Form>
</div>

0 comments on commit 70fc34f

Please sign in to comment.