Skip to content

Commit

Permalink
init i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
rezk2ll committed Dec 3, 2023
1 parent b5db864 commit f48f92d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lib/components/landing/Hero.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { _ } from 'svelte-i18n';
import Logo from '../logo/Logo.svelte';
</script>

Expand All @@ -10,7 +11,7 @@
<h1
class="text-2xl leading-8 lg:text-4xl not-italic font-semibold lg:leading-[44px] text-center lg:text-left w-full"
>
Twake ID is your one entry access to all our services Chat, Mail and Drive
{$_('welcome')}
</h1>
<a
href="#start"
Expand Down
11 changes: 10 additions & 1 deletion src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { browser } from '$app/environment';
import { getLocaleFromNavigator, locale, waitLocale } from 'svelte-i18n';
import type { LayoutServerLoad } from './$types';
import '$lib/i18n';

export const load: LayoutServerLoad = async ({ locals }) => {
if (browser) {
locale.set(getLocaleFromNavigator());
}

await waitLocale();

export const load: LayoutServerLoad = ({ locals }) => {
return {
session: locals.session.data
};
Expand Down

0 comments on commit f48f92d

Please sign in to comment.