From 0ebb60f986682ad8d3538c2fd1d708a861e0b1fb Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 22 Aug 2022 15:49:08 -0700 Subject: migrate to sveltekit-i18n --- src/components/404.svelte | 6 +++--- src/components/About.svelte | 25 +++++++++++-------------- src/components/AppHeader.svelte | 6 +++--- src/components/FaqCard.svelte | 6 +++--- src/components/Footer.svelte | 10 +++++----- src/components/HowItWorksCard.svelte | 6 +++--- src/components/LandingHeader.svelte | 30 +++++++++++++++--------------- src/components/LandingHero.svelte | 12 ++++++------ src/components/LocaleSelector.svelte | 2 +- src/components/RegisterOrLogin.svelte | 18 +++++++++--------- 10 files changed, 59 insertions(+), 62 deletions(-) (limited to 'src/components') diff --git a/src/components/404.svelte b/src/components/404.svelte index 4d5be76e..08323d40 100644 --- a/src/components/404.svelte +++ b/src/components/404.svelte @@ -1,6 +1,6 @@
@@ -11,7 +11,7 @@ -

{$_('404.404')}

-

{$_('404.pageNotFound')}

+

{$t('404.404')}

+

{$t('404.pageNotFound')}

diff --git a/src/components/About.svelte b/src/components/About.svelte index db74fd96..257fc49c 100644 --- a/src/components/About.svelte +++ b/src/components/About.svelte @@ -1,22 +1,22 @@ -

{$_('about.header')}

+

{$t('about.header')}

- {@html $_('about.p1')} + {@html $t('about.p1')}

- {@html $_('about.p2')} + {@html $t('about.p2')}

- {@html $_('about.p3')} + {@html $t('about.p3')}

- {@html $_('about.p4')} + {@html $t('about.p4')}

@@ -24,17 +24,17 @@

- {$_('about.founder.header')} + {$t('about.founder.header')}

{$_('about.founder.name')}{$t('about.founder.name')} {$_('about.founder.position')}{$t('about.founder.position')}
@@ -57,16 +57,13 @@
    - {#each Object.values($json('about.founder.qualifications')) as qualification} -
  • {qualification}
  • - {/each}
-

{$_('about.locations.header')}

+

{$t('about.locations.header')}

- {@html $_('about.locations.description')} + {@html $t('about.locations.description')}

diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 1d24cb1d..7b3987d5 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -5,7 +5,7 @@ import { user, newPayment, colorTheme } from '$lib/store'; import { goto } from '$app/navigation'; import { Icon } from '$comp'; - import { _ } from 'svelte-i18n'; + import { t } from '$lib/translations'; export let avatarPosition = 'left-[calc(50vw-48px)]'; @@ -75,7 +75,7 @@ {/each} @@ -86,7 +86,7 @@ {:else} {$t('nav.signIn')} {/if} diff --git a/src/components/FaqCard.svelte b/src/components/FaqCard.svelte index 0d3a9fa7..918e03d6 100644 --- a/src/components/FaqCard.svelte +++ b/src/components/FaqCard.svelte @@ -1,5 +1,5 @@
-

{$_('faq.' + questionID + '.question')}

+

{$t('faq.' + questionID + '.question')}

- {$_('faq.' + questionID + '.answer')} + {$t('faq.' + questionID + '.answer')}

diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte index e2acd993..a1173f74 100644 --- a/src/components/Footer.svelte +++ b/src/components/Footer.svelte @@ -1,6 +1,6 @@
-

{$_('howItWorks.' + stepID + '.header')}

+

{$t('howItWorks.' + stepID + '.header')}

- {$_('howItWorks.' + stepID + '.description')} + {$t('howItWorks.' + stepID + '.description')}

diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte index acc83001..372c0b98 100644 --- a/src/components/LandingHeader.svelte +++ b/src/components/LandingHeader.svelte @@ -3,7 +3,7 @@ import { scroll } from '$lib/utils'; import { Icon, LocaleSelector } from '$comp'; import { user } from '$lib/store'; - import { _ } from 'svelte-i18n'; + import { t } from '$lib/translations'; export let howItWorks; export let faq; @@ -28,30 +28,30 @@ @@ -70,35 +70,35 @@ >
{$t('nav.howItWorks')} - + {$t('nav.about')} {#if !$user} {:else} {/if} diff --git a/src/components/LandingHero.svelte b/src/components/LandingHero.svelte index 6553d271..1415692e 100644 --- a/src/components/LandingHero.svelte +++ b/src/components/LandingHero.svelte @@ -2,7 +2,7 @@ import { goto } from '$app/navigation'; import { Icon, Image } from '$comp'; import { user } from '$lib/store'; - import { _ } from 'svelte-i18n'; + import { t } from '$lib/translations';
@@ -10,17 +10,17 @@

- {$_('landing.header_before_icon')} + {$t('landing.header_before_icon')} - {$_('landing.header_with_icon')} + {$t('landing.header_with_icon')} - {$_('landing.header_after_icon')} + {$t('landing.header_after_icon')}

- {$_('landing.subheader')} + {$t('landing.subheader')}

{#if !$user}
@@ -28,7 +28,7 @@ class="bg-black text-white border rounded-full px-6 py-2 font-bold" on:click={() => goto('/register')} > - {$_('nav.startInSeconds')} + {$t('nav.startInSeconds')}
{/if} diff --git a/src/components/LocaleSelector.svelte b/src/components/LocaleSelector.svelte index 2ae65986..4672a564 100644 --- a/src/components/LocaleSelector.svelte +++ b/src/components/LocaleSelector.svelte @@ -1,5 +1,5 @@ diff --git a/src/components/RegisterOrLogin.svelte b/src/components/RegisterOrLogin.svelte index acf98523..2d1ee6a5 100644 --- a/src/components/RegisterOrLogin.svelte +++ b/src/components/RegisterOrLogin.svelte @@ -4,7 +4,7 @@ import { user, token } from '$lib/store'; import { auth } from '$lib/socket'; import { goto } from '$app/navigation'; - import { _ } from 'svelte-i18n'; + import { t } from '$lib/translations'; export let pageID; @@ -30,11 +30,11 @@
-

{$_('login.' + pageID)}

+

{$t('login.' + pageID)}

- +
- + {#if revealPassword} - {$_('login.passwordRecommendation')} + {$t('login.passwordRecommendation')}

{:else}
{$_('login.forgotPassword')}{$t('login.forgotPassword')}
{/if}

- {pageID === 'register' ? $_('login.haveAccount') : $_('login.noAccount')} + {pageID === 'register' ? $t('login.haveAccount') : $t('login.noAccount')} - {pageID === 'register' ? $_('login.signIn') : $_('login.register')} + {pageID === 'register' ? $t('login.signIn') : $t('login.register')}

-- cgit v1.2.3