forked from blisstown/campfire
add i18n for console logs
This commit is contained in:
parent
b170a532f6
commit
7752585488
14 changed files with 77 additions and 31 deletions
|
@ -3,9 +3,12 @@ import { server } from '$lib/client/server.js';
|
|||
import { app } from '$lib/client/app.js';
|
||||
import { get, writable } from 'svelte/store';
|
||||
import { parsePost } from '$lib/post.js';
|
||||
import Lang from '$lib/lang';
|
||||
|
||||
export const timeline = writable([]);
|
||||
|
||||
const lang = Lang('en_GB');
|
||||
|
||||
let loading = false;
|
||||
|
||||
export async function getTimeline(clean) {
|
||||
|
@ -24,7 +27,7 @@ export async function getTimeline(clean) {
|
|||
);
|
||||
|
||||
if (!timeline_data) {
|
||||
console.error(`Failed to retrieve timeline.`);
|
||||
console.error(lang.string('logs.timeline_fetch_failed'));
|
||||
loading = false;
|
||||
return;
|
||||
}
|
||||
|
@ -37,10 +40,10 @@ export async function getTimeline(clean) {
|
|||
if (!post) {
|
||||
if (post === null || post === undefined) {
|
||||
if (post_data.id) {
|
||||
console.warn("Failed to parse post #" + post_data.id);
|
||||
console.warn(lang.string('logs.post_parse_failed_id', post_data.id));
|
||||
} else {
|
||||
console.warn("Failed to parse post:");
|
||||
console.warn(post_data);
|
||||
console.warn(lang.string('logs.post_parse_failed'));
|
||||
console.debug(post_data);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue