Skip to content

fix(i18n): complete German core frontend translations#2671

Open
Rowdy wants to merge 5 commits into
we-promise:mainfrom
Rowdy:fix/complete-german-core-localization
Open

fix(i18n): complete German core frontend translations#2671
Rowdy wants to merge 5 commits into
we-promise:mainfrom
Rowdy:fix/complete-german-core-localization

Conversation

@Rowdy

@Rowdy Rowdy commented Jul 12, 2026

Copy link
Copy Markdown

Summary

German users no longer encounter English fallbacks across the core dashboard, accounts, transactions, budgets, categories, reports, navigation, chat, and loan flows. Period labels, month names, dates, account-group actions, financial terms, and supporting menu text now follow the active locale consistently.

The change also adds a structural regression test for German/English key and interpolation parity, plus focused coverage for localized custom period labels and account-type capitalization. This reduces 397 statically used German fallbacks while keeping locale interpolation contracts aligned.

Validation

  • bin/rails test: 5,376 runs, 22,140 assertions, 0 failures, 0 errors, 28 existing skips
  • Focused i18n, period, reports, and pages tests: 62 runs, 180 assertions, 0 failures
  • RuboCop on changed Ruby test/model files: no offenses
  • git diff --check: clean

No screenshots are included because validation used synthetic test data only and must not expose details from a private Sure instance.

Post-Deploy Monitoring & Validation

No additional operational monitoring is required. Validate representative core routes with the German locale and watch for missing-translation or interpolation errors; revert this PR if localized rendering regresses.


Compound Engineering
Codex

Summary by CodeRabbit

  • New Features
    • Expanded and refined localized UI copy across German and English, including navigation, budgets, reports, transactions, onboarding, chat, holdings, breadcrumbs, and shared labels (footer/community fork and app version).
  • Bug Fixes
    • Improved locale-aware date rendering throughout the UI (month/day/year labels and date ranges in reports/prints, splits/transactions), plus consistent localized custom period comparison labels.
    • Updated accessibility aria labels to use localized text.
  • Tests
    • Added/expanded i18n and month/year/period localization tests to catch locale and interpolation regressions.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR expands German localization coverage, replaces hardcoded date and UI text with Rails I18n helpers, adds localized period comparison labels, improves accessibility translations, and introduces tests for locale structure, interpolation consistency, and localization bypasses.

Changes

Localization contracts and enforcement

Layer / File(s) Summary
Period labels, capitalization, and localization checks
app/models/period.rb, config/locales/models/period/*, app/views/accounts/_accountable_group.html.erb, test/models/*, test/i18n/*
Period comparison ranges and account-group nouns now use localization-aware formatting, with tests covering locale structure, interpolation variables, template bypasses, capitalization, and localized output.

Localized view rendering

Layer / File(s) Summary
Dates, reports, transactions, and shared UI
app/views/budget_categories/*, app/views/budgets/*, app/views/layouts/*, app/views/pages/*, app/views/reports/*, app/views/shared/*, app/views/splits/*, app/views/transactions/*, app/views/valuations/*
Hardcoded date formats, footer text, version labels, transaction labels, report ranges, and accessibility strings now use localized helpers or translation keys.

German locale coverage

Layer / File(s) Summary
Core and feature translations
config/locales/breadcrumbs/*, config/locales/models/*, config/locales/views/*
German translations were added or revised across breadcrumbs, accounts, budgets, categories, chat, components, holdings, loans, onboarding, pages, reports, shared UI, users, trades, and transaction workflows.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • we-promise/sure#1817: Both modify period comparison-label localization and period translation handling.
  • we-promise/sure#1922: Both update period custom comparison-label translations using start/end interpolation.
  • we-promise/sure#2043: The Vietnamese period locale supplies custom comparison-label data used by the updated localization checks.

Suggested reviewers: jjmata

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the PR’s main change: completing German core frontend translations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57086d0717

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/models/period.rb

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
config/locales/views/loans/de.yml (1)

19-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider using a YAML anchor to eliminate duplicated overview keys.

tabs.overview (lines 28-37) is an exact copy of overview (lines 19-26) with one additional key (edit_loan_details). If a label changes in one block, the other can easily fall out of sync.

♻️ Optional refactor using YAML merge key
   overview: &loans_overview
     interest_rate: Zinssatz
     monthly_payment: Monatliche Zahlung
     not_applicable: Nicht zutreffend
     original_principal: Ursprünglicher Darlehensbetrag
     remaining_principal: Verbleibender Darlehensbetrag
     term: Laufzeit
     type: Typ
     unknown: Unbekannt
   tabs:
     overview:
-      interest_rate: Zinssatz
-      monthly_payment: Monatliche Zahlung
-      not_applicable: Nicht zutreffend
-      original_principal: Ursprünglicher Darlehensbetrag
-      remaining_principal: Verbleibender Darlehensbetrag
-      term: Laufzeit
-      type: Typ
-      unknown: Unbekannt
+      <<: *loans_overview
       edit_loan_details: Darlehensdetails bearbeiten
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/locales/views/loans/de.yml` around lines 19 - 37, Use a YAML anchor
for the shared loan label mappings under overview, then merge that anchor into
tabs.overview and retain only the additional edit_loan_details key there.
Preserve all existing translated labels while eliminating the duplicated keys.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/locales/views/accounts/de.yml`:
- Around line 110-111: Update the German confirm_body_html translation to add
periods at both sentence boundaries: between “auswirkt” and “Diese Aktion”, and
between “werden” and “Du müsstest”. Preserve the existing wording and HTML
structure.

In `@config/locales/views/transactions/de.yml`:
- Line 126: Remove the duplicate scalar transactions.merge_duplicate entry near
the button labels, preserving show.merge_duplicate for the button text and the
later merge_duplicate mapping containing success and failure messages. Ensure
only the result-message mapping remains under transactions.merge_duplicate.

---

Nitpick comments:
In `@config/locales/views/loans/de.yml`:
- Around line 19-37: Use a YAML anchor for the shared loan label mappings under
overview, then merge that anchor into tabs.overview and retain only the
additional edit_loan_details key there. Preserve all existing translated labels
while eliminating the duplicated keys.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5e6aa1e1-f224-4105-8ae4-6703b6c844b6

📥 Commits

Reviewing files that changed from the base of the PR and between 8d649bc and 57086d0.

📒 Files selected for processing (45)
  • app/models/period.rb
  • app/views/accounts/_accountable_group.html.erb
  • app/views/budget_categories/show.html.erb
  • app/views/budgets/_picker.html.erb
  • app/views/layouts/shared/_footer.html.erb
  • app/views/pages/changelog.html.erb
  • app/views/reports/_budget_performance.html.erb
  • app/views/reports/_period_picker.html.erb
  • app/views/reports/index.html.erb
  • app/views/reports/print.html.erb
  • app/views/shared/_app_version.html.erb
  • app/views/splits/edit.html.erb
  • app/views/splits/new.html.erb
  • app/views/transactions/convert_to_trade.html.erb
  • app/views/transactions/show.html.erb
  • app/views/valuations/_confirmation_contents.html.erb
  • config/locales/breadcrumbs/de.yml
  • config/locales/models/category/de.yml
  • config/locales/models/period/de.yml
  • config/locales/models/period/en.yml
  • config/locales/views/accounts/de.yml
  • config/locales/views/budgets/de.yml
  • config/locales/views/categories/de.yml
  • config/locales/views/chats/de.yml
  • config/locales/views/components/de.yml
  • config/locales/views/holdings/de.yml
  • config/locales/views/ibkr_items/de.yml
  • config/locales/views/kraken_items/de.yml
  • config/locales/views/layout/de.yml
  • config/locales/views/layout/en.yml
  • config/locales/views/loans/de.yml
  • config/locales/views/onboardings/de.yml
  • config/locales/views/other_assets/de.yml
  • config/locales/views/pages/de.yml
  • config/locales/views/pages/en.yml
  • config/locales/views/recurring_transactions/de.yml
  • config/locales/views/reports/de.yml
  • config/locales/views/reports/en.yml
  • config/locales/views/shared/de.yml
  • config/locales/views/shared/en.yml
  • config/locales/views/trades/de.yml
  • config/locales/views/transactions/de.yml
  • config/locales/views/users/de.yml
  • test/i18n/german_core_localization_test.rb
  • test/models/period_test.rb

Comment thread config/locales/views/accounts/de.yml Outdated
Comment thread config/locales/views/transactions/de.yml Outdated
Rowdy pushed a commit to Rowdy/sure that referenced this pull request Jul 12, 2026
- localize custom period comparisons in every supported period locale
- fix German punctuation and duplicate transaction translation key
- cover comparison-range interpolation across all period locales
@Rowdy

Rowdy commented Jul 12, 2026

Copy link
Copy Markdown
Author

Consider using a YAML anchor to eliminate duplicated overview keys.

Not addressing this optional refactor: the locale files intentionally keep the two translation namespaces explicit and structurally parallel with other locales. Introducing a German-only YAML merge would add parsing/maintenance complexity without changing runtime behavior.

@jjmata jjmata left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough i18n work — good test coverage in test/i18n/german_core_localization_test.rb and consistent use of Minitest (no RSpec/FactoryBot). Found two issues that I think should be fixed before merging:

1. date.formats.month_year doesn't exist for German (or most other locales), so the new l(..., format: :month_year) calls will silently fall back to English month names

This PR replaces hardcoded strftime("%B %Y") with l(date, format: :month_year) in three places:

  • app/views/budget_categories/show.html.erb:34
  • app/views/reports/_budget_performance.html.erb:7
  • app/views/reports/print.html.erb:27 (footer)

But config/locales/defaults/de.yml only defines date.formats.{default,long,short} — there's no month_year key, and this PR doesn't add one. Since config.i18n.fallbacks = true (config/application.rb:28), l(date, format: :month_year) for :de will fall back to en's "%B %Y", rendering English month names for German users — the exact regression this PR is meant to fix, just relocated. I checked all locale files under config/locales/defaults/; only ca, en, fr, ru, and zh-CN define month_year, so this affects de plus ~10 other locales.

Suggest adding date.formats.month_year (and ideally short_month_year, used elsewhere) to de.yml — or the other locale defaults that are missing it — before switching these call sites over.

2. Dropping .downcase in app/views/accounts/_accountable_group.html.erb:59 changes rendering for every locale, not just German

The change:

- text: t("accounts.sidebar.new_account_group", account_group: account_group.accountable_type.singular_display_name.downcase),
+ text: t("accounts.sidebar.new_account_group", account_group: account_group.accountable_type.singular_display_name),

singular_display_name resolves through I18n.t("accounts.types.#{name.underscore}"), which returns capitalized strings (e.g. "Credit Card"). Every other locale's new_account_group string embeds %{account_group} assuming a lowercase, mid-sentence noun — e.g. en.yml: "New %{account_group}", fr.yml: "Nouveau %{account_group}", plus es, pl, nl, ca, ro, pt-BR, hu, vi, zh-TW. Only the German string was reworded to compensate ("%{account_group} hinzufügen", noun-first). As-is, this will render "New Credit Card" instead of "New credit card" in English and similarly odd capitalization in the other unaudited locales.

Since this is a shared, non-German-specific view, either restore .downcase and give German its own capitalized-noun phrasing without touching the call site, or audit/update every locale's new_account_group string to match the new capitalization.

Everything else (the bulk YAML additions, the l(...)/t(...) replacements for :long/:short formats, the new Period#localized_comparison_range helper) looks correct and in scope.


Generated by Claude Code

Rowdy pushed a commit to Rowdy/sure that referenced this pull request Jul 13, 2026
- localize month-year labels without missing named-format fallbacks
- preserve lowercase account types outside German
- cover German, English, and French rendering regressions
@Rowdy

Rowdy commented Jul 13, 2026

Copy link
Copy Markdown
Author

@jjmata Thanks for the detailed review — both issues are addressed in 063905fa.

date.formats.month_year doesn’t exist for German (or most other locales)

Addressed slightly differently: the three call sites introduced by this PR now use the explicit localized format %B %Y. This keeps month names locale-aware (März 2026 / March 2026) without adding named formats to 112 unrelated locale files or changing pre-existing call sites.

Dropping .downcase changes rendering for every locale, not just German

Addressed with a locale-controlled capitalization flag. Existing lowercase behavior remains the default through the English fallback, while German explicitly preserves noun capitalization. Regression coverage now asserts New loan, Darlehen hinzufügen, and Nouveau prêt.

Validation: full suite 5,379 runs / 22,163 assertions / 0 failures / 0 errors; focused i18n and affected-controller tests 60 runs / 203 assertions; RuboCop and ERB lint clean.

A re-review would be appreciated when convenient.

Copy link
Copy Markdown
Collaborator

Periodic review sweep: commit 063905f (pushed after @jjmata's review) addresses both flagged points — localized month_year formatting without adding fallback-prone named formats, and a locale-controlled capitalization flag preserving lowercase for non-German locales — with added regression coverage. Full CI (test_unit, lint, test_system, etc.) is now green as of the latest run. The author's request for re-review is still unanswered; flagging so it doesn't get lost.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Automated review sweep: the two issues jjmata flagged on 07-13 (missing month_year locale fallback, and the .downcase regression affecting other locales) appear fixed in today's commit, with regression tests added. The 07-13 re-review request is still outstanding — flagging so this doesn't fall through the cracks.


Generated by Claude Code

@Rowdy
Rowdy requested a review from jjmata July 21, 2026 21:17
@jjmata
jjmata requested a review from gariasf July 21, 2026 21:33
@jjmata

jjmata commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Some interesting i18n changes here, can you review and share your feedback @gariasf?

Copy link
Copy Markdown
Collaborator

The two review rounds (month_year format, the cross-locale .downcase regression) both look properly fixed with regression tests, and the German translation coverage itself looks solid. @gariasf — following up on jjmata's request for a second look, since this touches 53 files across most of the core UI; a quick pass before merge would help close this out.


Generated by Claude Code

Johns added 4 commits July 24, 2026 19:40
- localize custom period comparisons in every supported period locale
- fix German punctuation and duplicate transaction translation key
- cover comparison-range interpolation across all period locales
- localize month-year labels without missing named-format fallbacks
- preserve lowercase account types outside German
- cover German, English, and French rendering regressions
@jjmata
jjmata force-pushed the fix/complete-german-core-localization branch from ac1d3db to bb31ab2 Compare July 25, 2026 02:40

@jjmata jjmata left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the CI tests that broke as a result of the rebase? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants