Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

485 B
Raw Blame
import { derived } from 'svelte/store';
import { locale } from './stores.js';
import en from './locales/en.json';
import zhCN from './locales/zh-CN.json';

const translations = { 'en': en, 'zh-CN': zhCN };

export const t = derived(locale, ($locale) => {
	const dict = translations[$locale] || en;
	return (key, vars = {}) => {
		let str = dict[key] ?? en[key] ?? key;
		for (const [k, v] of Object.entries(vars)) {
			str = str.replace(`{${k}}`, String(v));
		}
		return str;
	};
});