File tree Expand file tree Collapse file tree 3 files changed +49
-14
lines changed
Expand file tree Collapse file tree 3 files changed +49
-14
lines changed Original file line number Diff line number Diff line change 1313jobs :
1414 i18n-health :
1515 runs-on : ubuntu-latest
16+ env :
17+ # Ensure dev/test gems (incl. i18n-tasks) are installed
18+ BUNDLE_WITHOUT : " "
19+ BUNDLE_WITH : " development:test"
1620 if : github.event_name == 'push' || github.event_name == 'pull_request'
1721 steps :
1822 - name : Checkout code
@@ -21,23 +25,14 @@ jobs:
2125 uses : ruby/setup-ruby@v1
2226 with :
2327 ruby-version : ' 3.4.4'
24- - name : Install dependencies
25- run : |
26- gem install bundler
27- bundle install
28+ bundler-cache : true
2829 - name : Normalize locale files
29- run : |
30- bundle exec i18n-tasks normalize
31- - name : Check missing translations
32- run : |
33- bundle exec i18n-tasks check-missing
34- - name : Check consistent interpolations
35- run : |
36- bundle exec i18n-tasks check-consistent-interpolations
30+ run : bin/i18n normalize
31+ - name : Run i18n checks
32+ run : bin/i18n check
3733 - name : Upload i18n health report
3834 if : always()
39- run : |
40- bundle exec i18n-tasks health > i18n-health.txt
35+ run : bin/i18n health > i18n-health.txt
4136 continue-on-error : true
4237 - name : Archive i18n health report
4338 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ Instructions for GitHub Copilot and other automated contributors working in this
2323- ** Lint:** ` bundle exec rubocop `
2424- ** Security:** ` bundle exec brakeman --quiet --no-pager ` and ` bundle exec bundler-audit --update `
2525- ** Style:** ` bin/codex_style_guard `
26+ - ** I18n:** ` bin/i18n [normalize|check|health|all] ` (runs normalize + missing + interpolation checks by default)
2627
2728## Security Requirements
2829## Security Requirements
@@ -105,6 +106,9 @@ i18n-tasks add-missing
105106i18n-tasks health
106107```
107108
109+ ## CI Note
110+ - The i18n GitHub Action installs dev/test gem groups to make ` i18n-tasks ` available. Locally, you can mirror CI with ` bin/i18n ` , which sets ` BUNDLE_WITH=development:test ` automatically.
111+
108112See ` .github/instructions/i18n-mobility.instructions.md ` for additional translation rules.
109113
110114# Testing Requirements
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ # Ensure i18n-tasks (in development/test groups) is available
5+ export DISABLE_SPRING=1
6+ export BUNDLE_WITH=" ${BUNDLE_WITH:- development: test} "
7+ export BUNDLE_WITHOUT=" ${BUNDLE_WITHOUT:- } "
8+
9+ usage () {
10+ echo " Usage: bin/i18n [normalize|check|health|all]" >&2
11+ }
12+
13+ cmd=" ${1:- all} "
14+
15+ case " $cmd " in
16+ normalize)
17+ bundle exec i18n-tasks normalize
18+ ;;
19+ check)
20+ bundle exec i18n-tasks check-missing
21+ bundle exec i18n-tasks check-consistent-interpolations
22+ ;;
23+ health)
24+ bundle exec i18n-tasks health
25+ ;;
26+ all)
27+ bundle exec i18n-tasks normalize
28+ bundle exec i18n-tasks check-missing
29+ bundle exec i18n-tasks check-consistent-interpolations
30+ ;;
31+ * )
32+ usage
33+ exit 1
34+ ;;
35+ esac
36+
You can’t perform that action at this time.
0 commit comments