docs(i18n): mark the directory-by-directory migration complete (#2453)
Co-authored-by: Kandev Agent <agent@kandev.dev>
This commit is contained in:
+12
-7
@@ -17,11 +17,11 @@ Two enforcement layers, and it matters which is which:
|
||||
- **New code is guarded everywhere.** Copy you add — in a new file, or on a line
|
||||
you changed — must go through `t()` / `<Trans>` whatever directory it is in.
|
||||
See [the new-code ratchet](#but-new-code-is-guarded-everywhere).
|
||||
- **Whole files are guarded only once migrated.** The eslint literal rule errors
|
||||
- **Whole files are guarded only once listed.** The eslint literal rule errors
|
||||
across an entire file only for the paths in `i18nGuardFiles`, so you are never
|
||||
asked to migrate lines you did not touch. See
|
||||
[The guard is scoped](#the-guard-is-scoped-on-purpose) and
|
||||
[Migrating a directory](#migrating-a-directory).
|
||||
[Externalizing a path](#externalizing-a-path).
|
||||
|
||||
## TL;DR for adding a string
|
||||
|
||||
@@ -336,8 +336,8 @@ all three.
|
||||
|
||||
### …but new code is guarded everywhere
|
||||
|
||||
Scoping the whole-file guard leaves a hole: a brand-new component under an
|
||||
un-migrated directory would be unchecked. `check-new-code-i18n.mjs` closes it by
|
||||
Scoping the whole-file guard leaves a hole: a brand-new component under a path
|
||||
that is not on the list would be unchecked. `check-new-code-i18n.mjs` closes it by
|
||||
judging the **change** rather than the file:
|
||||
|
||||
| | Judged on |
|
||||
@@ -352,12 +352,17 @@ this can be repo-wide without recreating the treadmill. It is the same contract
|
||||
|
||||
So there are two independent ratchets, and both only tighten:
|
||||
|
||||
- **`i18nGuardFiles`** — whole files, migrated paths. Grows one directory per PR.
|
||||
- **`i18nGuardFiles`** — whole files, listed paths. Grew one directory per PR
|
||||
through the migration; now grows when a PR adds a path that renders copy.
|
||||
- **the new-code ratchet** — new lines, everywhere. Always on.
|
||||
|
||||
## Migrating a directory
|
||||
## Externalizing a path
|
||||
|
||||
One directory per PR. The whole loop:
|
||||
The directory-by-directory sweep of the screens is **finished** — #2367 localized
|
||||
`app/office`, the last un-migrated area. This loop is what you still run for a
|
||||
path you are adding, for a helper directory the sweep did not cover (`lib/sidebar`
|
||||
is one), or to remediate a blind-spot find like the SCREAMING_CASE tables in PR
|
||||
`#2409`:
|
||||
|
||||
```bash
|
||||
cd apps/web
|
||||
|
||||
Reference in New Issue
Block a user