Every session paid ~4 000 tokens for CLAUDE.md and .claude/rules/, and part of
that content no longer described this repository:
CLAUDE.md and 05-environments.md gave .venv.odoo18/bin/python — a path that
does not exist. The real one carries BOTH versions,
.venv.odoo18.0_python3.12.10. 02-project-structure.md announced addons/ and
odoo12.0/, absent from the checkout.
That is the reason for the cuts, more than the token count: the files drifted
from the repository, while « ls » cannot. What a session can rebuild by
reading the code is now left to the code.
02-project-structure.md deleted — a tree that ls gives, and gives right
05-environments.md deleted — a venv list that was simply false
04-code-conventions.md reduced to a pointer at .flake8, .editorconfig and
pyproject.toml, which already hold every value it
repeated, plus the Git conventions, which they
do not
01-versions.md table dropped for the pointer at
conf/supported_version_erplibre.json, whose keys
already pair Odoo with Python
Two blocks move to lazy loading — their body costs nothing until invoked:
03-commands.md -> skill erplibre-commands (kept whole: there is no
« make help » target, and the per-module test recipes
carry flags nobody would guess)
07-documentation.md -> skill erplibre-doc-i18n for the how-to, while the
prohibition « never edit a generated .md » STAYS in
the rules: a rule that must hold at all times cannot
live in a file loaded on demand
Resident guidance: ~3 997 -> ~1 939 est. tokens per session.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2.5 KiB
2.5 KiB
| name | description |
|---|---|
| erplibre-doc-i18n | Documentation bilingue ERPLibre (mmg, fichiers .base.md) et internationalisation du CLI TODO (todo_i18n.py, clés TRANSLATIONS). À charger pour rédiger ou régénérer de la documentation, ou pour ajouter une chaîne traduisible au CLI. |
Documentation multilingue
La documentation est bilingue (anglais/français) via mmg (Multilingual Markdown Generator).
Fonctionnement
- Les fichiers sources sont les
.base.md(contiennent les deux langues) mmggénère :FICHIER.md(anglais) etFICHIER.fr.md(français)- Marqueurs :
<!-- [en] -->,<!-- [fr] -->,<!-- [common] -->(blocs de code partagés)
Commandes
make doc_markdown # Regénérer toute la doc multilingue
Convention
- Toujours modifier le fichier
.base.mdcorrespondant, puis exécutermake doc_markdown - Les blocs de code vont dans
<!-- [common] -->, le texte dans<!-- [en] -->et<!-- [fr] --> - En-tête obligatoire dans chaque
.base.md:
<!---------------------------->
<!-- multilingual suffix: en, fr -->
<!-- no suffix: en -->
<!---------------------------->
Les fichiers concernés se listent par
find . -name '*.base.md'.
Internationalisation du CLI TODO (i18n)
Le CLI interactif script/todo/todo.py supporte le français et l'anglais.
Architecture
script/todo/todo_i18n.py— Module de traduction (dictionnaireTRANSLATIONS, fonctionst(),get_lang(),set_lang())- Les chaînes traduisibles utilisent
t("clé")au lieu de texte en dur - Les entrées de
todo.jsonpeuvent avoir un champprompt_description_keyrésolu viat()(fallback surprompt_description)
Résolution de la langue (priorité)
EL_LANGdansenv_var.sh(lu en premier, défaut"fr")- Variable d'environnement
EL_LANG - Défaut :
"fr"
Comportement
- Première exécution : prompt bilingue demande à l'utilisateur de choisir sa langue
- Le choix est persisté dans
env_var.sh - Changement de langue possible via TODO > Configuration > Langue
Ajouter une traduction
- Ajouter la clé dans
TRANSLATIONSdetodo_i18n.pyavec les valeurs"fr"et"en" - Remplacer la chaîne en dur par
t("ma_clé")danstodo.py - Pour les entrées JSON : ajouter
"prompt_description_key": "ma_clé"danstodo.json
La clé EST la chaîne anglaise. Vérifier l'absence de doublon dans
TRANSLATIONSavant d'ajouter : une clé en double écrase silencieusement la précédente.