feedback5 W5S: a language switch in the middle of a screen re-reads the game texts — useGameData(), the 干员调配 / 干员持有 rosters, the strategy list and the open detail card list data.locale() among their memo dependencies (they kept the records of the language they were built in); docs/I18N.md

This commit is contained in:
sganggs committed 2026-10-06 18:35:33 +08:00
1 parent c2e77c7fe9
commit 250ad254a6
6 files changed
+8 -6

No files matched your search

+2 -1
View File
@@ -24,7 +24,8 @@ export const GAME_FILES = ['config', 'assets', 'chess', 'bonds', 'items', 'bands
*/
export function useGameData() {
const ready = useData(...GAME_FILES);
return useMemo(() => makeLookups(ready), [ready]);
// (config / factions / choices are read once per memo: a language switch reads them again in the new locale)
return useMemo(() => makeLookups(ready), [ready, data.locale()]);
}
/** A 自选 operator's summon record (data/backups.json `tokens`, 0.2.0), or null. */