add localisation support
currently only en_GB (TODO: dynamic language pack imports)
This commit is contained in:
parent
970590497f
commit
e326ac858e
17 changed files with 263 additions and 90 deletions
|
@ -2,11 +2,14 @@
|
|||
import { page } from '$app/stores';
|
||||
import { account } from '$lib/stores/account.js';
|
||||
import { timeline, getTimeline } from '$lib/timeline.js';
|
||||
import Lang from '$lib/lang.js';
|
||||
|
||||
import LoginForm from '$lib/ui/LoginForm.svelte';
|
||||
import Button from '$lib/ui/Button.svelte';
|
||||
import Post from '$lib/ui/post/Post.svelte';
|
||||
|
||||
const lang = Lang('en_GB');
|
||||
|
||||
account.subscribe(account => {
|
||||
if (account) getTimeline();
|
||||
});
|
||||
|
@ -21,18 +24,18 @@
|
|||
|
||||
{#if $account}
|
||||
<header>
|
||||
<h1>Home</h1>
|
||||
<h1>{lang.string('timeline.home')}</h1>
|
||||
<nav>
|
||||
<Button centered active>Home</Button>
|
||||
<Button centered disabled>Local</Button>
|
||||
<Button centered disabled>Federated</Button>
|
||||
<Button centered active>{lang.string('timeline.home')}</Button>
|
||||
<Button centered disabled>{lang.string('timeline.local')}</Button>
|
||||
<Button centered disabled>{lang.string('timeline.federated')}</Button>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div id="feed" role="feed">
|
||||
{#if $timeline.length <= 0}
|
||||
<div class="loading throb">
|
||||
<span>getting the feed...</span>
|
||||
<span>{lang.string('timeline.fetching')}</span>
|
||||
</div>
|
||||
{/if}
|
||||
{#each $timeline as post}
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import Notification from '$lib/ui/Notification.svelte';
|
||||
import Lang from '$lib/lang.js';
|
||||
|
||||
const lang = Lang('en_GB');
|
||||
|
||||
if (!$account) goto("/");
|
||||
|
||||
|
@ -31,13 +34,13 @@
|
|||
</script>
|
||||
|
||||
<header>
|
||||
<h1>Notifications</h1>
|
||||
<h1>{lang.string('navigation.notifications')}</h1>
|
||||
</header>
|
||||
|
||||
<div class="notifications">
|
||||
{#if $notifications.length === 0}
|
||||
<div class="loading throb">
|
||||
<span>fetching notifications...</span>
|
||||
<span>{lang.string('notification.fetching')}</span>
|
||||
</div>
|
||||
{:else}
|
||||
{#each $notifications as notif}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue