add missing i18n for post view

This commit is contained in:
ari melody 2025-07-13 18:49:49 +01:00
parent 30f3aadeaa
commit b74b19cc73
Signed by: ari
GPG key ID: CF99829C92678188
13 changed files with 27 additions and 16 deletions

View file

@ -32,7 +32,9 @@
"profile_information": "Profile information", "profile_information": "Profile information",
"settings": "Settings", "settings": "Settings",
"log_out": "Log out" "log_out": "Log out",
"back": "Back"
}, },
"timeline": { "timeline": {
@ -57,6 +59,8 @@
}, },
"post": { "post": {
"loading": "loading post...",
"by": "Post by %1",
"time": "%1 ago", "time": "%1 ago",
"boosted": "%1 boosted this post.", "boosted": "%1 boosted this post.",
"actions": { "actions": {
@ -82,6 +86,7 @@
"compose": "Post", "compose": "Post",
"search": "Search", "search": "Search",
"loading": "just a moment...",
"source": "source", "source": "source",
"issues": "issues" "issues": "issues"

View file

@ -1,4 +1,4 @@
import Lang from '$lib/lang.js'; import Lang from '$lib/lang';
const lang = Lang('en_GB'); const lang = Lang('en_GB');
const denoms = [ const denoms = [

View file

@ -7,7 +7,7 @@
import { timeline } from '$lib/timeline.js'; import { timeline } from '$lib/timeline.js';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { playSound } from '$lib/sound'; import { playSound } from '$lib/sound';
import Lang from '$lib/lang.js' import Lang from '$lib/lang'
import Button from '@cf/ui/Button.svelte'; import Button from '@cf/ui/Button.svelte';
import PostIcon from '@cf/icons/post.svg'; import PostIcon from '@cf/icons/post.svg';

View file

@ -3,7 +3,7 @@
import { server, createServer } from '$lib/client/server.js'; import { server, createServer } from '$lib/client/server.js';
import { app } from '$lib/client/app.js'; import { app } from '$lib/client/app.js';
import { get } from 'svelte/store'; import { get } from 'svelte/store';
import Lang from '$lib/lang.js'; import Lang from '$lib/lang';
import Logo from '$lib/../img/campfire-logo.svg'; import Logo from '$lib/../img/campfire-logo.svg';

View file

@ -10,7 +10,7 @@
import { page } from '$app/stores'; import { page } from '$app/stores';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { notifications, unread_notif_count } from '$lib/notifications.js'; import { notifications, unread_notif_count } from '$lib/notifications.js';
import Lang from '$lib/lang.js'; import Lang from '$lib/lang';
import Logo from '$lib/../img/campfire-logo.svg'; import Logo from '$lib/../img/campfire-logo.svg';
import Button from './Button.svelte'; import Button from './Button.svelte';

View file

@ -9,7 +9,7 @@
// import QuoteIcon from '$lib/../img/icons/quote.svg'; // import QuoteIcon from '$lib/../img/icons/quote.svg';
import ReactionBar from '$lib/ui/post/ReactionBar.svelte'; import ReactionBar from '$lib/ui/post/ReactionBar.svelte';
import ActionBar from '$lib/ui/post/ActionBar.svelte'; import ActionBar from '$lib/ui/post/ActionBar.svelte';
import Lang from '$lib/lang.js'; import Lang from '$lib/lang';
const lang = Lang('en_GB'); const lang = Lang('en_GB');

View file

@ -1,5 +1,5 @@
<script> <script>
import Lang from '$lib/lang.js'; import Lang from '$lib/lang';
const lang = Lang('en_GB'); const lang = Lang('en_GB');
</script> </script>

View file

@ -1,6 +1,6 @@
<script> <script>
import { shorthand as short_time } from '$lib/time.js'; import { shorthand as short_time } from '$lib/time.js';
import Lang from '$lib/lang.js'; import Lang from '$lib/lang';
const lang = Lang('en_GB'); const lang = Lang('en_GB');

View file

@ -1,6 +1,6 @@
<script> <script>
import { shorthand as short_time } from '$lib/time.js'; import { shorthand as short_time } from '$lib/time.js';
import Lang from '$lib/lang.js'; import Lang from '$lib/lang';
const lang = Lang('en_GB'); const lang = Lang('en_GB');

View file

@ -6,12 +6,15 @@
import { account } from '$lib/stores/account.js'; import { account } from '$lib/stores/account.js';
import { parseAccount } from '$lib/account.js'; import { parseAccount } from '$lib/account.js';
import { unread_notif_count, last_read_notif_id } from '$lib/notifications.js'; import { unread_notif_count, last_read_notif_id } from '$lib/notifications.js';
import Lang from '$lib/lang';
import Navigation from '$lib/ui/Navigation.svelte'; import Navigation from '$lib/ui/Navigation.svelte';
import Modal from '@cf/ui/Modal.svelte'; import Modal from '@cf/ui/Modal.svelte';
import Composer from '@cf/ui/Composer.svelte'; import Composer from '@cf/ui/Composer.svelte';
import Widgets from '$lib/ui/Widgets.svelte'; import Widgets from '$lib/ui/Widgets.svelte';
const lang = Lang('en_GB');
let show_composer = false; let show_composer = false;
async function init() { async function init() {
@ -48,7 +51,7 @@
<main> <main>
{#await init()} {#await init()}
<div class="loading throb"> <div class="loading throb">
<span>just a moment...</span> <span>{lang.string('loading')}</span>
</div> </div>
{:then} {:then}
<slot></slot> <slot></slot>

View file

@ -2,7 +2,7 @@
import { page } from '$app/stores'; import { page } from '$app/stores';
import { account } from '$lib/stores/account.js'; import { account } from '$lib/stores/account.js';
import { timeline, getTimeline } from '$lib/timeline.js'; import { timeline, getTimeline } from '$lib/timeline.js';
import Lang from '$lib/lang.js'; import Lang from '$lib/lang';
import LoginForm from '$lib/ui/LoginForm.svelte'; import LoginForm from '$lib/ui/LoginForm.svelte';
import Button from '$lib/ui/Button.svelte'; import Button from '$lib/ui/Button.svelte';

View file

@ -4,13 +4,16 @@
import { app } from '$lib/client/app.js'; import { app } from '$lib/client/app.js';
import { parsePost } from '$lib/post.js'; import { parsePost } from '$lib/post.js';
import { goto, afterNavigate } from '$app/navigation'; 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 Post from '$lib/ui/post/Post.svelte';
import Button from '$lib/ui/Button.svelte'; import Button from '$lib/ui/Button.svelte';
export let data; export let data;
const lang = Lang('en_GB');
let post = fetchPost(data.post_id); let post = fetchPost(data.post_id);
let error = false; let error = false;
let previous_page = base; let previous_page = base;
@ -68,7 +71,7 @@
{#await post} {#await post}
<div class="loading throb"> <div class="loading throb">
<span>loading post...</span> <span>{lang.string('post.loading')}</span>
</div> </div>
{:then post} {:then post}
{#if error} {#if error}
@ -77,12 +80,12 @@
<header> <header>
{#if previous_page} {#if previous_page}
<nav> <nav>
<Button centered on:click={() => {goto(previous_page)}}>Back</Button> <Button centered on:click={() => {goto(previous_page)}}>{lang.string('navigation.back')}</Button>
</nav> </nav>
{/if} {/if}
<img src={post.account.avatar_url} type={post.account.avatar_type || "image/png"} alt="" width="40" height="40" class="header-avatar" loading="lazy" decoding="async"> <img src={post.account.avatar_url} type={post.account.avatar_type || "image/png"} alt="" width="40" height="40" class="header-avatar" loading="lazy" decoding="async">
<h1> <h1>
Post by {@html post.account.rich_name} {@html lang.string('post.by').replaceAll('%1', post.account.rich_name)}
</h1> </h1>
</header> </header>

View file

@ -4,7 +4,7 @@
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { page } from '$app/stores'; import { page } from '$app/stores';
import Notification from '$lib/ui/Notification.svelte'; import Notification from '$lib/ui/Notification.svelte';
import Lang from '$lib/lang.js'; import Lang from '$lib/lang';
const lang = Lang('en_GB'); const lang = Lang('en_GB');