From 66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 1 Oct 2026 16:34:55 -0700 Subject: The standalone wallet opened from a disk shows its avatars, font and languages. With no files beside it, relative punks/, locales/, nip46.js and jsqr.js looked on the disk. From file:// they now come from v3.coinos.io (images and scripts need no CORS; /locales/ now sends Access-Control-Allow-Origin on the server), and standalone.html carries Public Sans inline. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VP5Ljqk7EYcm5QQAbzDwog --- src/i18n.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/i18n.js') diff --git a/src/i18n.js b/src/i18n.js index 951bc8d..8d67b3a 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -1,3 +1,4 @@ +import { assetUrl } from './asset-url.js'; // Lightweight i18n. t('key', {vars}) interpolates {var} and falls back to the // English string (then the key). The chosen language persists in localStorage; // otherwise it's guessed from the browser. Arabic/Urdu render right-to-left. @@ -1307,7 +1308,7 @@ const _inflight = new Map(); export function loadLocale(code) { if (code === 'en' || STR[code] || !SUPPORTED.has(code)) return Promise.resolve(); if (_inflight.has(code)) return _inflight.get(code); - const p = fetch('locales/' + code + '.json') + const p = fetch(assetUrl('locales/' + code + '.json')) .then((r) => (r.ok ? r.json() : null)) .then((d) => { if (d) STR[code] = d; }) .catch(() => {}) -- cgit v1.2.3