🤖 Open-source, local-first alternative to Grok Bot, OpenAI dots and Claude Duet. Your own AI bots on any model: GPT, Claude, Gemini, Grok, DeepSeek, Kimi, GLM and 70+ more through one Modelflare key. Reach them in the app, WeChat or Feishu; they remember you, work in the background, run commands and use your computer. Pay per use.
Python ai-agentai-assistantchatbotclaudecomputer-usedeepseekdesktop-appdshelectronfeishugeminigptgrokllmlocal-firstmodelflaremulti-modelopenai-compatiblepersonal-ai-agentwechat
import { describe, expect, it } from "vitest";
import { LANGS, LOCALES, href, normalizeLang, switchHref } from "../src/i18n/locales";
import siteManifest from "../src/i18n/manifest.json";
import appManifest from "../../ui/locales/manifest.json";
import { fmtMoney, fmtSmall } from "../src/lib/calc";
import { fmtPrice } from "../src/lib/pricing";
import { localizeSnapshotUSD } from "../src/lib/locale-format";
import { headingUnits } from "../src/lib/heading-units";
describe("locale URLs and presentation", () => {
it("keeps Korean words and Japanese loanwords together in animated headings", () => {
expect(headingUnits("내 기기에서 실행하는", "ko")).toContain("기기에서");
expect(headingUnits("あなたのデバイスで動く", "ja")).toContain("デバイス");
expect(headingUnits("AI アシスタント", "ja")).toContain("アシスタント");
expect(headingUnits("Hello world", "en").join("")).toBe("Hello world");
});
it("keeps the app and standalone site's language manifests in sync", () => {
expect(siteManifest).toEqual(appManifest);
expect([...LANGS]).toEqual(appManifest.locales.map((l) => l.siteCode));
});
it.each([["ja-JP", "ja"], ["ko_KR.UTF-8", "ko"], ["ru-RU", "ru"], ["zh-Hans", "zh"], ["english", undefined]])("recognizes complete language subtags: %s", (input, expected) => {
expect(normalizeLang(input!)).toBe(expected);
});
it("preserves pages, query strings and fragments across language links", () => {
for (const lang of LANGS) {
expect(switchHref(lang, "/pricing?m=demo#calc")).toBe(`${lang === "zh" ? "" : `/${lang}`}/pricing?m=demo#calc`);
expect(switchHref(lang, "/404")).toBe(href(lang, "/"));
expect(LOCALES[lang].tag).toBe(lang === "zh" ? "zh-CN" : lang);
}
});
it("formats Russian decimal separators while keeping prices in US dollars", () => {
expect(fmtMoney(1234.5, "ru").replaceAll("\u00a0", " ")).toBe("1 234,50 $");
expect(fmtMoney(0.001, "ru").replaceAll("\u00a0", " ")).toBe("< 0,01 $");
expect(fmtSmall(0.001234, "ru").replaceAll("\u00a0", " ")).toBe("0,001234 $");
expect(fmtPrice(0.25, "ja")).toBe("$0.25");
expect(fmtPrice(0.25, "ko")).toBe("$0.25");
expect(localizeSnapshotUSD("$1.20", "ru").replaceAll("\u00a0", " ")).toBe("1,20 $");
});
});