Files
OpenFrontIO/tests
scamiv 12733900a4 test(i18n): validate ICU syntax across all translation files (#3170)
## Description:

This PR adds a translation validation test to catch malformed ICU
message syntax during test runs instead of only at runtime.

## What changed
- Added `tests/LangIcuMessages.test.ts`.
- The test scans all `resources/lang/*.json` files (excluding
`metadata.json`).
- It flattens nested translation objects into dot-keys.
- It validates each translation string by compiling it with
`IntlMessageFormat`.
- It fails with explicit `file:key` errors for:
  - Invalid ICU syntax
  - Invalid translation value types (non-string leaves)

## Why
Today malformed translation strings only surface as console warnings at
runtime. This test moves detection into CI/test execution, giving fast
and deterministic feedback.

## How to run
```bash
npx vitest run tests/LangIcuMessages.test.ts
```

## Notes
The new test currently surfaces existing malformed ICU strings (not
introduced by this PR), especially `send_troops_modal.slider_tooltip`,
`send_troops_modal.capacity_note`, and `send_gold_modal.slider_tooltip`
in multiple locale files.


## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] I have added relevant tests to the test directory
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

DISCORD_USERNAME
2026-02-10 16:31:50 -08:00
..
2026-02-09 13:37:27 -08:00
2025-12-20 13:35:30 -08:00
2025-12-20 13:35:30 -08:00
2026-01-11 20:11:14 -08:00
2026-01-08 13:34:18 -08:00
2026-01-27 00:29:52 +00:00
2026-01-19 19:28:45 -08:00
2025-12-20 13:35:30 -08:00
2025-11-19 12:32:01 -08:00