@@ -51,12 +53,15 @@
{/await}
{/if}
+ {#if pinned}
+
{lang.string('post.pinned')}
+ {/if}
{#if is_boost && !post_context.text}
{/if}
{mouse_pos.left = e.pageX; mouse_pos.top = e.pageY}}
on:mouseup={e => {if (e.pageX == mouse_pos.left && e.pageY == mouse_pos.top) gotoPost(e)}}
@@ -74,18 +79,24 @@
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index aec6b96..da9df9a 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,17 +1,20 @@
{#if $account}
-
- Home
-
-
+
+
+
+
+
-
- {#if $timeline.length <= 0}
-
- getting the feed...
-
- {/if}
- {#each $timeline as post}
-
- {/each}
-
+
{:else}
{/if}
diff --git a/src/routes/[server]/[account]/[post]/+page.js b/src/routes/[server]/[account]/[post]/+page.js
index 0cd52c3..107da19 100644
--- a/src/routes/[server]/[account]/[post]/+page.js
+++ b/src/routes/[server]/[account]/[post]/+page.js
@@ -1,4 +1,8 @@
export async function load({ params }) {
+ let handle = params.account;
+ if (handle.startsWith('@'))
+ handle = handle.substring(1);
+
return {
server_host: params.server,
account_handle: params.account,
diff --git a/src/routes/[server]/[account]/[post]/+page.svelte b/src/routes/[server]/[account]/[post]/+page.svelte
index 75daa65..f4c345c 100644
--- a/src/routes/[server]/[account]/[post]/+page.svelte
+++ b/src/routes/[server]/[account]/[post]/+page.svelte
@@ -4,13 +4,16 @@
import { app } from '$lib/client/app.js';
import { parsePost } from '$lib/post.js';
import { goto, afterNavigate } from '$app/navigation';
- import { base } from '$app/paths'
+ import { base } from '$app/paths';
+ import Lang from '$lib/lang';
import Post from '$lib/ui/post/Post.svelte';
import Button from '$lib/ui/Button.svelte';
export let data;
+ const lang = Lang();
+
let post = fetchPost(data.post_id);
let error = false;
let previous_page = base;
@@ -30,16 +33,16 @@
// TODO: make `server` a key/value pair to support multiple servers
server.set(await createServer(data.server_host));
if (!$server) {
- error = `Failed to connect to ${data.server_host}
.`;
- console.error(`Failed to connect to ${data.server_host}.`);
+ error = lang.string('error.connection_failed', data.server_host);
+ console.error(lang.string('logs.connection_failed', data.server_host));
return;
}
}
const post_data = await api.getPost($server.host, token, post_id);
if (!post_data || post_data.error) {
- error = `Failed to retrieve post ${post_id}
.`;
- console.error(`Failed to retrieve post ${post_id}.`);
+ error = lang.string('error.post_fetch_failed_id', post_id);
+ console.error(lang.string('logs.post_fetch_failed_id', post_id));
return;
}
let post = await parsePost(post_data, 0);
@@ -68,7 +71,7 @@
{#await post}
- loading post...
+ {lang.string('post.loading')}
{:then post}
{#if error}
@@ -77,12 +80,12 @@
{#if previous_page}
{/if}
-
+
- Post by {@html post.account.rich_name}
+ {@html lang.string('post.by', post.account.rich_name)}
diff --git a/src/routes/callback/+page.svelte b/src/routes/callback/+page.svelte
index 8b6985e..b52e328 100644
--- a/src/routes/callback/+page.svelte
+++ b/src/routes/callback/+page.svelte
@@ -8,17 +8,20 @@
import { error } from '@sveltejs/kit';
import { unread_notif_count, last_read_notif_id } from '$lib/notifications.js';
import { account } from '$lib/stores/account.js';
+ import Lang from '$lib/lang';
export let data;
+ const lang = Lang();
+
let auth_code = data.code;
if (!auth_code || !get(server) || !get(app)) {
- error(400, { message: "Bad request" });
+ error(400, { message: lang.string('error.bad_request') });
} else {
api.getToken(get(server).host, get(app).id, get(app).secret, auth_code).then(token => {
if (!token) {
- error(400, { message: "Invalid auth code provided" });
+ error(400, { message: lang.string('error.invalid_auth_code') });
}
app.update(app => {
@@ -30,7 +33,7 @@
if (!data) return goto("/");
account.set(parseAccount(data));
- console.log(`Logged in as @${get(account).username}@${get(account).host}`);
+ console.log(lang.string('logs.logged_in', get(account).fqn));
// spin up async task to fetch notifications
return api.getNotifications(
diff --git a/src/routes/favourites/+page.svelte b/src/routes/favourites/+page.svelte
new file mode 100644
index 0000000..0bd0331
--- /dev/null
+++ b/src/routes/favourites/+page.svelte
@@ -0,0 +1,36 @@
+
+
+
+
+
+ {#if $timeline.length <= 0}
+
+ {lang.string('timeline.fetching')}
+
+ {/if}
+ {#each $timeline as post}
+
+ {/each}
+
\ No newline at end of file
diff --git a/src/routes/follow-requests/+page.svelte b/src/routes/follow-requests/+page.svelte
new file mode 100644
index 0000000..f37a69a
--- /dev/null
+++ b/src/routes/follow-requests/+page.svelte
@@ -0,0 +1,152 @@
+
+
+
+
+{#if $followRequests.length < 1}
+{lang.string('follow_requests.none')}
+{/if}
+
+
+ {#each $followRequests as req}
+
+
+
+
+
+
+
+
+
+
+ {/each}
+
+
+
\ No newline at end of file
diff --git a/src/routes/notifications/+page.svelte b/src/routes/notifications/+page.svelte
index c6294d8..128293d 100644
--- a/src/routes/notifications/+page.svelte
+++ b/src/routes/notifications/+page.svelte
@@ -4,6 +4,10 @@
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import Notification from '$lib/ui/Notification.svelte';
+ import PageHeader from '../../lib/ui/core/PageHeader.svelte';
+ import Lang from '$lib/lang';
+
+ const lang = Lang();
if (!$account) goto("/");
@@ -30,14 +34,12 @@
});
-
+
{#if $notifications.length === 0}
- fetching notifications...
+ {lang.string('notification.fetching')}
{:else}
{#each $notifications as notif}
@@ -47,18 +49,6 @@