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
|
@ -7,6 +7,7 @@
|
|||
import { timeline } from '$lib/timeline.js';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { playSound } from '$lib/sound';
|
||||
import Lang from '$lib/lang.js'
|
||||
|
||||
import Button from '@cf/ui/Button.svelte';
|
||||
import PostIcon from '@cf/icons/post.svg';
|
||||
|
@ -19,6 +20,8 @@
|
|||
import FollowersVisIcon from '@cf/icons/followers.svg';
|
||||
import PrivateVisIcon from '@cf/icons/dm.svg';
|
||||
|
||||
const lang = Lang('en_GB');
|
||||
|
||||
export let reply_id;
|
||||
|
||||
let content_warning = ""
|
||||
|
@ -27,15 +30,9 @@
|
|||
let show_cw = false;
|
||||
let visibility = "Public";
|
||||
|
||||
const placeholders = [
|
||||
"What's cooking, $1?",
|
||||
"Speak your mind!",
|
||||
"Federate something...",
|
||||
"I sure love posting!",
|
||||
"Another day, another $1 post!",
|
||||
];
|
||||
let placeholder = placeholders[Math.floor(placeholders.length * Math.random())]
|
||||
.replaceAll("$1", $account.username);
|
||||
const placeholders = lang.stringArray('compose_placeholders');
|
||||
let placeholder = Array.isArray(placeholders) ? placeholders[Math.floor(placeholders.length * Math.random())]
|
||||
.replaceAll("$1", $account.username) : placeholders;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue