Commit 6a18c16
docs: improve react-intl documentation for React Server Components (#3085)
## Summary
- Document `createIntl` from `@formatjs/intl` as the recommended
approach for i18n in Server Components — a context-free API with full
interpolation, pluralization, and date/number formatting
- Add limitations section for the plain `messages['key']` lookup pattern
(only works for pre-formatted strings, renders ICU `{variable}`
placeholders as literal text)
- Document Rails pre-formatting (`I18n.t('key', name: value)`) as a
valid alternative for Server Components
- Add comparison table reconciling build-time (`config.i18n_dir`) vs
controller-props i18n approaches
- Fix vague i18next claim in `rsc-third-party-libs.md` with concrete
per-request `createInstance()` guidance
- Add RSC cross-reference section to the build-time i18n docs
- Update compatibility decision matrix with `createIntl` recommendation
Fixes #3081
## Test plan
- [ ] Verify all internal markdown links resolve correctly
- [ ] Review `createIntl` code examples for accuracy against FormatJS
docs
- [ ] Confirm build-time vs controller-props comparison table is
accurate
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: documentation-only updates that don’t change runtime code,
limited to guidance/examples for i18n usage in RSC.
>
> **Overview**
> Adds **React Server Components i18n guidance** across the docs,
recommending `react-intl`’s context-free `createIntl` API for Server
Components and documenting Rails-side pre-formatting as an alternative.
>
> Clarifies the limitations of direct `messages['key']` lookups with ICU
placeholders, adds a build-time vs controller-props comparison table,
and updates the RSC third-party compatibility docs/matrix to reflect the
`createIntl` recommendation and more concrete `i18next` per-request
setup notes.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
eb62286. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Added a comprehensive guide for internationalization with React Server
Components, recommending server-side formatting patterns and a
controller pre-formatting alternative.
* Reintroduced explicit client-side provider pattern for Client
Components.
* Added a build-time vs request-time comparison table and updated
third-party library compatibility guidance (including per-request
i18next considerations).
* Expanded common mistakes with placeholder and formatting guidance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 6a399b0 commit 6a18c16
3 files changed
Lines changed: 111 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
186 | 197 | | |
187 | 198 | | |
188 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
| |||
369 | 373 | | |
370 | 374 | | |
371 | 375 | | |
372 | | - | |
373 | | - | |
374 | | - | |
| 376 | + | |
375 | 377 | | |
376 | | - | |
| 378 | + | |
377 | 379 | | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
384 | 386 | | |
385 | 387 | | |
386 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
387 | 395 | | |
388 | 396 | | |
| 397 | + | |
389 | 398 | | |
390 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
391 | 403 | | |
392 | | - | |
393 | | - | |
| 404 | + | |
394 | 405 | | |
395 | 406 | | |
396 | 407 | | |
397 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
398 | 413 | | |
399 | 414 | | |
400 | 415 | | |
| |||
403 | 418 | | |
404 | 419 | | |
405 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
406 | 459 | | |
407 | 460 | | |
408 | 461 | | |
| |||
415 | 468 | | |
416 | 469 | | |
417 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
418 | 480 | | |
419 | 481 | | |
420 | 482 | | |
| |||
468 | 530 | | |
469 | 531 | | |
470 | 532 | | |
471 | | - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
472 | 551 | | |
473 | 552 | | |
474 | 553 | | |
| |||
482 | 561 | | |
483 | 562 | | |
484 | 563 | | |
485 | | - | |
| 564 | + | |
486 | 565 | | |
487 | 566 | | |
488 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
| 367 | + | |
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| |||
0 commit comments