Files
EVEngine/test/i18n_script.cpp
sunxfancy b954ac9fd5 feat(i18n): add game localization module
Add an i18n module (eve.I18n) for game localization:
- Load per-language JSON locale tables from VFS or raw JSON.
- Dot-path key lookup with {name} placeholder substitution.
- CLDR-style plural rules (en/fr/ru/pl/cs/zh and more).
- Fall back to default language, then to the raw key.
- Optional file auto-reload via update(dt).

Self-contained JSON parser (no Poco) so it builds on WASM too.
Includes C++ + Squirrel script tests, user/module docs, an
examples/i18n demo, and i18n integration in the dialogue example.
2026-08-17 14:54:50 +08:00

12 lines
286 B
C++

#include "ScriptTest.h"
extern const char* i18n_content;
UnitSciptTest(I18nScriptTest, i18n_content);
#define TestScript(func) \
TEST_CASE_FIXTURE(I18nScriptTest, "I18nScriptTest." #func) { \
CHECK(vm.callFunc(vm.findFunc(#func), vm).toBool()); \
}
TestScript(basic)