/* i18n.jsx — minimal EN/中文 helper.
   tr(en, zh) returns the string for the current language. App calls setAppLang()
   to keep this global in sync with its React state, so toggling language
   re-renders the whole tree and every tr() call resolves to the new language. */
let APP_LANG = 'en';
function setAppLang(l) { APP_LANG = l; }
function getAppLang() { return APP_LANG; }
function tr(en, zh) { return (APP_LANG === 'zh' && zh != null) ? zh : en; }

Object.assign(window, { tr, setAppLang, getAppLang });
