Skip to content

Commit 49179d1

Browse files
committed
Developer conventions: logic keys on reference-table IDs, never on label strings (labels are translated and can change; IDs never do). README EN + FR, llms.txt
1 parent 87f4f35 commit 49179d1

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

‎docs/developers/README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ flowchart LR
9595
own format version for backward compatibility.
9696
- **Naming** — self-describing names over encoded/clever ones; no
9797
multi-state magic values.
98+
- **IDs, never labels** — any logic that depends on a value from the
99+
reference tables (`id_aspect`, `id_brand`, `id_material`, `id_type`,
100+
`id_diameter`, `id_measure_unit`, `id_version`…) compares its **numeric ID**,
101+
never its label as a string. A label is display text: it is translated, it
102+
can be renamed or corrected in the reference database, and it reads
103+
differently in every language — an ID never changes. Keep the ID next to the
104+
label, name the IDs you branch on (e.g. aspect `Tricolor 24`, `Rainbow 145`,
105+
`Bicolor 252`), and use labels for display only.
98106
- **Colour** — a spool's colour is stored as data, not as a picture, so every
99107
surface must turn that data into the same picture:
100108
[the material swatch convention](./material-swatch.md) is normative, and

‎i18n/fr/developers/README.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sourceHash: 8ae1c06de17fcd742ec5955b2ae95cc97016fada033c19b74bb58ac0e04bce58
2+
sourceHash: dbd78eb2f02db455a2f9d0c54788c50a84b2c83b37d02e49d90f48adbd504d71
33
sourcePath: docs/developers/README.md
44
---
55

@@ -108,6 +108,15 @@ flowchart LR
108108
rétrocompatibilité.
109109
- **Nommage** — des noms auto-descriptifs plutôt qu'encodés ou astucieux ; pas
110110
de valeurs magiques à états multiples.
111+
- **Des ID, jamais des libellés** — toute logique qui dépend d'une valeur des
112+
tables de référence (`id_aspect`, `id_brand`, `id_material`, `id_type`,
113+
`id_diameter`, `id_measure_unit`, `id_version`…) compare son **ID
114+
numérique**, jamais son libellé sous forme de chaîne. Un libellé est un texte
115+
d'affichage : il est traduit, il peut être renommé ou corrigé dans la base de
116+
référence, et il se lit différemment dans chaque langue — un ID ne change
117+
jamais. Gardez l'ID à côté du libellé, nommez les ID sur lesquels vous
118+
branchez (par ex. aspect `Tricolor 24`, `Rainbow 145`, `Bicolor 252`), et
119+
réservez les libellés à l'affichage.
111120
- **Couleur** — la couleur d'une bobine est stockée comme une donnée, pas comme
112121
une image, donc chaque surface doit transformer cette donnée en la même image :
113122
[la convention de la pastille de matière](./material-swatch.md) est normative,

‎llms.txt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,10 @@ brand using TigerTag, and of spools makers tag themselves at home.
302302
- [Products](docs/products/README.md): one page per product
303303
- [Compatibility](docs/compatibility/README.md): per-brand printer links + native RFID formats
304304
- [Compatible third-party hardware](docs/compatibility/third-party-hardware.md): the growing list — ACR122U, AJAX-3D TD-1/TD1s, DYMO/HID USB scales, blank NTAG chips
305-
- [Developers](docs/developers/README.md): repo map, SDKs, cloud integration
305+
- [Developers](docs/developers/README.md): repo map, SDKs, cloud integration.
306+
NORMATIVE convention: logic on a reference-table value (id_aspect, id_brand,
307+
id_material, id_type…) compares the numeric ID, NEVER the label string —
308+
labels are translated and can be renamed, IDs never change
306309
- [The material swatch](docs/developers/material-swatch.md): NORMATIVE — how spool
307310
colour data becomes a picture (bicolor and tricolor = 135° soft split — solid colours, 20 % blended seam — 4+ hard
308311
colours = camembert, rainbow/declared gradient = 135° ramp; convention v1.2;

0 commit comments

Comments
 (0)