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
|
@ -1,6 +1,9 @@
|
|||
import { server } from '$lib/client/server.js';
|
||||
import { parseEmoji, renderEmoji } from '$lib/emoji.js';
|
||||
import { get, writable } from 'svelte/store';
|
||||
import Lang from '$lib/lang';
|
||||
|
||||
const lang = Lang('en_GB');
|
||||
|
||||
const cache = writable({});
|
||||
|
||||
|
@ -11,7 +14,7 @@ const cache = writable({});
|
|||
*/
|
||||
export function parseAccount(data) {
|
||||
if (!data) {
|
||||
console.error("Attempted to parse account data but no data was provided");
|
||||
console.error(lang.string('logs.account_data_empty'));
|
||||
return null;
|
||||
}
|
||||
let account = get(cache)[data.id];
|
||||
|
@ -20,7 +23,7 @@ export function parseAccount(data) {
|
|||
|
||||
account = {};
|
||||
account.id = data.id;
|
||||
account.nickname = data.display_name.trim();
|
||||
account.nickname = data.display_name.trim().replaceAll('<', '<').replaceAll('>', '>');
|
||||
account.username = data.username;
|
||||
account.name = account.nickname || account.username;
|
||||
account.avatar_url = data.avatar;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue