1.2 KiB
1.2 KiB
Project Rules
Localization (required)
Every change or addition must include an update to js/i18n.js: review and update the translations and localization behavior affected by the change.
Every user-facing string must go through js/i18n.js. Never hardcode Thai or English UI text in HTML or JS.
- Use
data-i18n,data-i18n-placeholder,data-i18n-title,data-i18n-altordata-i18n-aria-labelinindex.html. - Use
t('key', { ...vars })for strings rendered from JavaScript (includinginnerHTMLtemplates). - Add every new key to
MODAL_AND_TOOL_TRANSLATIONSinjs/i18n.jsfor boththanden. Other locales intentionally fall back to English throught(), so they do not need duplicate entries. - When a language changes, dynamic content must refresh. Call the render function from
applyTranslations()(for examplerenderEquipTargetDisplay()andrenderAvatarAssignGrid()). - Keep every import of
i18n.json the same?v=query string so the browser uses a single module instance. Bump it wheneverjs/i18n.jschanges.
Cache busting
When css/styles.css or js/app.js changes, bump its ?v= query string in index.html.
Scope
Do not modify README.md or the untracked docs/ folder unless the task explicitly asks for it.