Skip to content

Add Japanese translation with path-prefix locale routing#23

Merged
adrianthedev merged 5 commits into
mainfrom
feat/japanese-translation
Apr 2, 2026
Merged

Add Japanese translation with path-prefix locale routing#23
adrianthedev merged 5 commits into
mainfrom
feat/japanese-translation

Conversation

@adrianthedev

Copy link
Copy Markdown
Contributor

Summary

  • Add i18n infrastructure with path-prefix locale routing (/ja/... for Japanese, / for English)
  • Extract ~200 hardcoded English strings from all 4 public pages into YAML locale files using Rails lazy lookup t() helpers
  • Extract duplicated footer into shared partial, internationalize navigation
  • Add EN/日本語 language switcher to desktop and mobile navigation
  • Generate Japanese translations for all public content
  • Handle JS progress text in checklist controller via Stimulus value

Context

The site will be used at an upcoming Japanese Ruby event. Japanese-speaking attendees need the content in their language.

Key decisions

  • Path prefix (/ja/) over subdomain — simpler, no DNS config
  • Nested YAML keys by view using Rails lazy lookup convention
  • Shared footer partial extracted during i18n work to avoid 4x duplication
  • Auth, admin, and mailer routes remain English-only outside the locale scope

Test plan

  • All 4 public pages render at both / and /ja/ URLs
  • Auth routes work without locale prefix
  • Unsupported locales return 404
  • Language switcher preserves current page
  • JS checklist progress text works with translated template
  • Full test suite passes (20 tests, 56 assertions, 0 failures)

Post-Deploy Monitoring & Validation

  • Check /ja/ pages render without missing translation errors
  • Verify language switcher links work on all 4 pages
  • Confirm checklist progress counter displays correctly in Japanese
  • Spot-check Japanese translations on key pages for obvious errors

Set up path-prefix locale routing (/ja/...) with optional locale scope
for public routes. Auth and admin routes remain outside the scope.
Add set_locale and default_url_options to ApplicationController.
Configure available_locales [:en, :ja] and set HTML lang attribute.
…tcher

Extract duplicated footer into shared _footer.html.erb partial.
Internationalize navigation and footer strings with t() helpers.
Add EN/日本語 language switcher to desktop and mobile navigation.
Fix hardcoded href="/" links to use root_path for locale awareness.
Use current_page? helper for active link detection.
Extract ~200 hardcoded English strings from all 4 public pages
into t() helper calls with nested YAML locale files per view.
Handle JS progress text in checklist controller via Stimulus value.
Restore shared footer partial renders that worktree agents reverted.
Generate ja.yml translations for navigation, footer, and all 4 public
pages (home, organizer guide, checklist, stamp samples). Proper nouns,
interpolation variables, and HTML markup preserved.
@adrianthedev
adrianthedev merged commit 4d08344 into main Apr 2, 2026
0 of 4 checks passed
@adrianthedev
adrianthedev deleted the feat/japanese-translation branch April 2, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant