test(i18n): say how the variable guard reads nesting and unescaped forms (#480)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m13s

Neither locale file uses $t(…) nesting or the unescaped {{- …}} form
yet. The header of the guard now says what would happen if one came:
a nested key is not compared, and {{- name}} reads as the token
"- name", a gap against {{name}}. Comments only.

Resolves #480

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
le king fu 2026-10-23 20:16:58 -04:00
commit bb3e98c344

View file

@ -20,6 +20,9 @@
// languages, and a format option left out on one side (`{{filter}}` against
// `{{filter, lowercase}}`) keeps the capital the sentence meant to drop: each
// leaf both files hold carries one set of tokens, format options included.
// Neither file nests a key (`$t(…)`) or writes the unescaped form (`{{- …}}`)
// yet: a nested key would not be compared, and `{{- name}}` would read as the
// token `- name`, a gap against `{{name}}`.
import { describe, it, expect } from "vitest";
import fr from "./locales/fr.json";