- replace the ~100-option avatar <select>s in Add Relic / Add Light Cone with a searchable picker modal (keep-in-inventory card + avatar cards with element/path/level) - warn when the chosen character already wears a relic in that slot or a light cone - click+Confirm or double-click applies; Esc closes only the picker; search autofocused - localize all new strings (th/en, other locales fall back to en) and refresh chips/picker on language change - add AGENTS.md with localization and cache-busting rules - bump app.js v3.20, styles.css v2.29, i18n.js v2.17 and align all i18n imports
20 lines
1.1 KiB
Markdown
20 lines
1.1 KiB
Markdown
# Project Rules
|
|
|
|
## Localization (required)
|
|
|
|
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-alt` or `data-i18n-aria-label` in `index.html`.
|
|
- Use `t('key', { ...vars })` for strings rendered from JavaScript (including `innerHTML` templates).
|
|
- Add every new key to `MODAL_AND_TOOL_TRANSLATIONS` in `js/i18n.js` for both `th` and `en`. Other locales intentionally fall back to English through `t()`, so they do not need duplicate entries.
|
|
- When a language changes, dynamic content must refresh. Call the render function from `applyTranslations()` (for example `renderEquipTargetDisplay()` and `renderAvatarAssignGrid()`).
|
|
- Keep every import of `i18n.js` on the same `?v=` query string so the browser uses a single module instance. Bump it whenever `js/i18n.js` changes.
|
|
|
|
## 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.
|