You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1fe5c71
Browse filesBrowse the repository at this point in the historyBrowse files
Words a reader sees that no table can translate are found, and fewer of them are left
Under i18n.literals, a text splicing more than a name, or a value shown by
a name that does not say it is words, was silently shown as written in
every language. I05 now warns of both where they are shown. A path with a
fallback, `{item?.name ?? ""}`, is keyed by its name, and a string an
action writes to a value named as words is looked up like a declared one.
A file name or a code word is not taken for prose.
Copy file name to clipboardExpand all lines: AGENTS.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2591,7 +2591,11 @@ the file has it in any language, falling back to `items.other` and then
2591
2591
`items` — the static paint and the live page by the same rules. A key's
2592
2592
forms come from one language. Under `i18n.literals`, text with one number
2593
2593
in it (`Text("{files} files")`) picks its form by that number:
2594
-
`"{files} files.one"`, `"{files} files.other"` … in each table. `format` and `ago` speak the locale too.
2594
+
`"{files} files.one"`, `"{files} files.other"` … in each table. Under
2595
+
literals a text is keyed by the names it splices (`{item?.name ?? ""}` is
2596
+
`{name}`); a `derived`, `state` or action-written value is looked up only
2597
+
when its name says it is words (`countText`, `emptyLabel`, `saidNote`);
2598
+
I05 warns of shown words that are neither. `format` and `ago` speak the locale too.
2595
2599
`wf translations` is the table: what each locale lacks, what nothing names.
2596
2600
2597
2601
RTL locales (automatic `dir="rtl"`, from the first paint when the default
@@ -3008,6 +3012,7 @@ And what the type checker finds:
3008
3012
|`I01`| A literal `t("key")` that no locale's translations have, so the page shows the key |
3009
3013
|`I02`| A message and its call that disagree: a value passed the message does not use, or a placeholder the call does not pass |
3010
3014
|`I04`|`setLocale("xx")` naming a locale `i18n.locales` does not list |
3015
+
|`I05`| Under `i18n.literals`, shown words no table can translate: text splicing more than a name, or a value shown by a name that does not say it is words |
3011
3016
|`V06`| A `$token` the resolved theme does not declare, so the property falls back to nothing |
3012
3017
3013
3018
An endpoint a service does not have is `T06`, and an argument it does not
Markdown("`setLocale(\"fr\")` when `i18n.locales` is `[\"en\", \"ar\"]`. **Fix:** add the locale and its file, or name one that exists.")
1275
1275
1276
+
Heading("I05 — Words a reader sees that are not translated", id: "i05-words-a-reader-sees-that-are-not-translated").h3
1277
+
1278
+
Markdown("Warning, under `\"literals\": true`. `Text(\"\{plural(n, \"file\")\} found\")` splices a call, so no table can key it; `derived said = \"\{n\} errors\"` shown as `Text(said)` is not looked up, because only a value whose name says it is words (`saidText`, `errorsLabel`) is. A reader in Arabic sees both in English. **Fix:** splice names, `derived filesText = \"\{n\} files\"` then `Text(\"\{filesText\} found\")`, and name what is words as words.")
1279
+
1276
1280
Heading("Accessibility", id: "accessibility").h2
1277
1281
1278
1282
Markdown("Warnings. What makes a page unusable with a screen reader, a keyboard or a voice.")
"`setLocale(\"xx\")` names a locale `i18n.locales` does not list.",
534
534
),
535
+
code(
536
+
"I05",
537
+
Warning,
538
+
"Words a reader sees that are not translated",
539
+
"Under `i18n.literals`, text that splices more than a name, or a value shown by a name that does not say it is words, is never looked up: every reader sees it as written.",
0 commit comments