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
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:
parent
fe91add0d4
commit
bb3e98c344
1 changed files with 3 additions and 0 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue