Files
foundryvtt-wh4-lang-fr-fr/AGENTS.md
T
uberwald c54a625a42 fix: correction des tests de Corruption pour la locale FR
- Remplacement des comparaisons localisées dans handleCorruptionResult
  par des chaînes anglaises en dur pour que les paliers de Corruption
  soient correctement appliqués
- Correction de _onResist pour accepter les valeurs anglaises et
  françaises de sévérité de Corruption
- Correction des liens @Corruption[modérée] → @Corruption[moderate]
  dans les scripts d'effets
- Élargissement de la clause de garde dans xS2su09zcza9du09.js pour
  couvrir les valeurs anglaises et françaises
- Ajout de AGENTS.md
2026-07-23 20:58:38 +02:00

2.9 KiB

AGENTS.md — foundryvtt-wh4-lang-fr-fr

FoundryVTT WFRP4e French translation module (wh4-fr-translation).

Quick start

npm run build           # packs scripts/*.js → modules/loadScripts.js (do NOT edit loadScripts.js manually)
python3 -mjson.tool fr.json > /dev/null    # validate JSON (CI check)
python3 -mjson.tool module.json > /dev/null

No test framework exists. Only automated check is JSON validity (.gitea/workflows/validate.yaml on every push).

Architecture

  • fr.json (2715 keys) — UI/system flat key→val translations (WFRP4E.* namespace)
  • compendium/*.json — compendium translations named {source-module}.{pack-type}.json; entries keyed by English id
  • scripts/*.js — ActiveEffect scripts named by Foundry item IDs (GUID-like a7v422EZcOUUC20X.js)
  • modules/loadScripts.jsgenerated by npm run build; never edit directly
  • modules/babele-register.js — registers all compendium JSONs with Babele at init hook; contains all converter logic
  • modules/addon-register.js — patches game.wfrp4e.config.* with French strings at init/ready
  • modules/config-patch.jsWH4FRPatchConfig class (skill list translation, talent list, NPC details)
  • modules/import-stat-2.js — French stat block parser (replaces WFRP4e default)
  • wh4_fr.js — entry point, inits travelv2 and inn submodules from modules/
  • packs/ — custom French compendium packs (LevelDB format)
  • patch-styles.css — CSS patches

Critical conventions

  • Never use French words as JS variable names in scripts/. Blessures and Tests shadow WFRP4e internals (the system uses game.wfrp4e.config.* lookup based on English names, and Blessures/Tests as variable names break this). Scan with:
    node find-blessures-variables.cjs
    node find-tests-variables.cjs
    
  • Conflicts in the release workflow: compatibility-verified: '13' in .gitea/workflows/release.yaml but "verified": "14" in module.json. The CI step overwrites the release yaml's value — but if adding module.json updates, match both.

Upstream sync workflow

When updating to a new WFRP4e release:

node tools/copy-new-scripts.js --list       # count new scripts
node tools/copy-new-scripts.js --dry-run    # preview
node tools/copy-new-scripts.js --copy       # copy new scripts
node tools/sync-scripts.js                  # compare scripts with upstream
node tools/translate-scripts.js             # apply auto-translation passes
node tools/check-tests.js                   # scan for "Tests" in scripts/ content

Release

Published via Gitea release. The zip includes: module.json, fr.json, wh4_fr.js, patch-styles.css, README.md, LICENSE, compendium/, modules/, packs/, icons/, images/, trade/.

Detailed architecture reference in .github/copilot-instructions.md.