Repository navigation
docs: internationalization (i18n) - #238
marcelo-maciel wants to merge 13 commits into
Conversation
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.
|
Reviewed - thorough page, and the culture-resolution chain + neutral-resx-name gotchas are exactly the right level of detail. Holding until upstream #1344 merges (still open). When it does: rebase over main's em-dash -> hyphen conversion, re-date the changelog section to the actual merge date, and double-check the final shipped config keys ( |
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).
# Conflicts: # src/content/docs/cross-cutting-concerns/index.mdx
|
Rebased onto The conflict was One consequence of that sweep worth naming, because it is silent. Converting Pre-existing on On scope: this PR stays whole and covers all four slices of the code split (fullstackhero/dotnet-starter-kit#1360, #1361, #1362, #1363) - |
# Conflicts: # src/content/docs/changelog/index.mdx
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.
Keeps both changelog entries in date order.
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.
…efinedCulturesOnly setting
…d placeholder drift
…ail 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.
Documents the internationalization (i18n) feature and adds the changelog entry.
The code PR this originally tracked, fullstackhero/dotnet-starter-kit#1344, was split into four on review request. This documentation covers all four, so it stays a single PR:
internationalization.mdxis one page whose sections map across the split, and cutting it into four would put four PRs on the same file and leave three of them describing half a feature.ConfigurationcodeonProblemDetailsinerror-handling.mdx{Module}Resourcescatalogs, localized messagesAccept-Language, switcher, locale-aware formattingPlease merge this after the last of the four, not with the first. Landing it alongside the framework slice alone would publish the module-catalog and front-end sections before that code is on
main, and a reader following those instructions would find nothing there. Docs lagging the code by a few merges is the safer direction (Golden Rule #10 is satisfied by the docs travelling with the change, and all four are in flight together).SharedResourcesplus per-module{Module}Resources), localizedProblemDetailsand FluentValidation messages, theUser.Localefield and fallback, and the front-endreact-i18nextsetup with enforceden-US/pt-BRkey parity.codeextension onProblemDetailsin the error-handling page, and corrects pre-existing drift in that table: it saidtitlewas the exception type name, which post-i18n is the localized title by status, with the type name only as fallback.