aboutsummaryrefslogtreecommitdiffstats
path: root/src/i18n.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-01 16:34:55 -0700
committerAdam Soltys <[email protected]>2026-10-01 16:34:55 -0700
commit66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa (patch)
treeb26348dfe27873e9bd610b67a5880de00cf3db72 /src/i18n.js
parenta7806172f7ede9be345750c93e5fa72e10e9b953 (diff)
downloadcoinosv3-66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa.tar.gz
coinosv3-66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01VP5Ljqk7EYcm5QQAbzDwog
Diffstat (limited to 'src/i18n.js')
-rw-r--r--src/i18n.js3
1 files changed, 2 insertions, 1 deletions
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(() => {})