Repository navigation
Commit 904bac6
docs: internationalization (i18n) (#238)
* docs: document internationalization (i18n)
Add a cross-cutting-concerns page covering end-to-end localization:
backend IStringLocalizer with neutral-culture resx and RequestLocalization,
the five-step culture-resolution chain, per-user User.Locale on the JWT
locale claim, and both React apps on react-i18next with a language switcher.
Includes an "adding a language" guide and a changelog entry.
* docs: document the ProblemDetails code extension
Localized problem details mean `detail` is prose in the caller's language, so
clients must branch on the exception's MessageKey, now emitted as a `code`
extension. Documents the field in Error handling, cross-links it from
Internationalization, and extends the i18n changelog entry.
Also corrects the CustomException row: `title` is the localized status title,
not the exception type name (the type name is only the fallback).
* docs(i18n): retarget the code anchor after the em dash sweep changed its slug
* docs(i18n): name the localStorage key the detector actually writes
The page said the resolved language is cached in localStorage and left the key
implicit, which reads as the library default. It is not: each app writes its
own namespaced key, matching everything else it persists. Someone clearing a
stuck language, writing a handoff, or deploying a second i18next app on the
same origin needs the actual name.
* docs(i18n): describe the localization the code actually ships
Catalogs are named for specific cultures (pt-BR), there is no culture cookie, only the UI culture is negotiated, the default is LocalizationOptions:DefaultCulture or en-US, module catalogs carry MessageKey/ResourceSource, and the dashboard switcher sends If-Match.
* docs(i18n): note the container's invariant globalization and the PredefinedCulturesOnly setting
* docs(i18n): only English must be complete; parity fails on orphans and placeholder drift
* docs(i18n): non-default languages load on demand, one chunk per language
* docs(i18n): exceptions attach keys with .Localized and missing keys fail the build
Follows fullstackhero/dotnet-starter-kit#1382 after review: the four-line
MessageKey/ResourceSource initializer is replaced by
.Localized<TResource>(key, args) on CustomException, and a new
Architecture.Tests guard fails the build on a key the code references but its
catalog lacks. The internationalization page and the i18n changelog entry
show the new form and describe the guard.
* docs(i18n): frontend keys are typed and the lint blocks untranslated JSX text
* docs(i18n): list the breaking changes for existing projects
* docs(changelog): date the i18n entry for its merge and link the upgrade notes
---------
Co-authored-by: iammukeshm <iammukeshm@gmail.com>1 parent f67fcc9 commit 904bac6
4 files changed
Lines changed: 269 additions & 5 deletions
File tree
- src/content/docs
- changelog
- cross-cutting-concerns
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
51 | 69 | | |
52 | 70 | | |
53 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments