Skip to content

Commit 99b380f

Browse files
committed
Adjust i18n.md to focus on locale idempotency feature only
Remove references to bin/dev automatic precompile hook coordination, as that feature will be in a separate PR.
1 parent 065f0c7 commit 99b380f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

docs/building-features/i18n.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,26 @@ You can use [Rails internationalization (i18n)](https://guides.rubyonrails.org/i
2121

2222
3. The locale files must be generated before `yarn build` using `rake react_on_rails:locale`.
2323

24+
The locale generation task is idempotent - it will skip generation if files are already up-to-date. This makes it safe to call multiple times without duplicate work:
25+
26+
```bash
27+
bundle exec rake react_on_rails:locale
28+
# Subsequent calls will skip if already up-to-date
29+
```
30+
31+
To force regeneration:
32+
33+
```bash
34+
bundle exec rake react_on_rails:locale force=true
35+
```
36+
2437
**Recommended: Use Shakapacker's precompile_hook with bin/dev** (React on Rails 16.2+, Shakapacker 9.3+)
2538

26-
The locale generation task is idempotent and can be safely called multiple times, automatically skipping generation if files are already up-to-date. Configure it in Shakapacker's `precompile_hook` and `bin/dev` will handle coordination automatically:
39+
Configure the idempotent task in `config/shakapacker.yml` to run automatically before webpack:
2740

2841
```yaml
2942
# config/shakapacker.yml
3043
default: &default
31-
# Run locale generation before webpack compilation
32-
# Safe to run multiple times - will skip if already built
3344
precompile_hook: 'bundle exec rake react_on_rails:locale'
3445
```
3546
@@ -41,11 +52,6 @@ You can use [Rails internationalization (i18n)](https://guides.rubyonrails.org/i
4152

4253
This eliminates the need for sleep hacks and manual coordination in `Procfile.dev`. See the [Process Managers documentation](./process-managers.md#precompile-hook-integration) for details.
4354

44-
To force regeneration:
45-
46-
```bash
47-
bundle exec rake react_on_rails:locale force=true
48-
```
4955

5056
**Alternative: Manual coordination**
5157

0 commit comments

Comments
 (0)