Skip to content

Polish localization: complete translations, pluralization fixes, and reusable locale audit tooling#1356

Merged
jjmata merged 8 commits into
we-promise:mainfrom
UberDudePL:feature/pl-translations-clean
Apr 7, 2026
Merged

Polish localization: complete translations, pluralization fixes, and reusable locale audit tooling#1356
jjmata merged 8 commits into
we-promise:mainfrom
UberDudePL:feature/pl-translations-clean

Conversation

@UberDudePL

@UberDudePL UberDudePL commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR finalizes Polish localization support and makes the localization QA process reusable for other locales.

What changed

  • Added/updated Polish locale files across the app (views, models, mailers, defaults, doorkeeper).
  • Ensured Polish pluralization consistency (one/few/many/other) in all detected plural blocks.
  • Added runtime rails-i18n dependency and enabled Polish in supported locales.
  • Added tests for Polish pluralization and locale-dependent money formatting behavior.
  • Added reusable locale audit tooling: generic locale audit + PL compatibility wrapper.
  • Added localization docs and generated Polish audit reports.

Validation

  • Locale audit for pl:
    • Files with suspicious English hits: 0
    • Plural blocks missing few/many: 0
  • Focused tests pass:
    • test/lib/polish_pluralization_test.rb
    • test/lib/money_test.rb
    • test/i18n_test.rb

Out of scope

  • Bond-related English locale change is intentionally excluded and handled in a separate PR.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Polish language support with comprehensive translations for all user-facing interfaces, including accounts, transactions, budgets, investments, reports, settings, and integrations.
  • Tooling & Quality

    • Introduced locale audit toolkit to validate translation completeness and pluralization rules across language packs.

…oling

- add and update Polish locale files across models, views, mailers, and shared translations
- add runtime rails-i18n dependency and Polish locale support in language helper
- add regression coverage for Polish pluralization and locale-aware money formatting
- introduce reusable locale audit script for any locale plus backward-compatible PL wrapper
- add localization audit docs and generated PL readiness/pluralization reports
- resolve one/few/many/other pluralization consistency for Polish locales
Copilot AI review requested due to automatic review settings April 2, 2026 22:56
@coderabbitai

coderabbitai Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 98e7323f-88b5-4611-b8ce-bdc200a37352

📥 Commits

Reviewing files that changed from the base of the PR and between 88e73d4 and 30e2aa0.

📒 Files selected for processing (9)
  • app/controllers/snaptrade_items_controller.rb
  • app/views/import/confirms/show.html.erb
  • config/locales/views/pdf_import_mailer/pl.yml
  • config/locales/views/snaptrade_items/de.yml
  • config/locales/views/snaptrade_items/en.yml
  • config/locales/views/snaptrade_items/es.yml
  • config/locales/views/snaptrade_items/pl.yml
  • script/pl_locale_audit.rb
  • test/lib/polish_pluralization_test.rb
✅ Files skipped from review due to trivial changes (3)
  • app/views/import/confirms/show.html.erb
  • config/locales/views/pdf_import_mailer/pl.yml
  • config/locales/views/snaptrade_items/pl.yml
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/controllers/snaptrade_items_controller.rb
  • test/lib/polish_pluralization_test.rb

📝 Walkthrough

Walkthrough

Adds comprehensive Polish language support by including the rails-i18n gem, updating SUPPORTED_LOCALES to include "pl", and creating 90+ Polish locale YAML files covering models, views, forms, and UI components. Also implements locale audit tooling and updates tests for Polish pluralization handling.

Changes

Cohort / File(s) Summary
Core Infrastructure
Gemfile, app/helpers/languages_helper.rb
Added rails-i18n gem dependency and registered "pl" locale in SUPPORTED_LOCALES constant.
Polish Locale Files — Models
config/locales/models/**/pl.yml
Added 20+ Polish locale files for ActiveRecord models (account, address, category, entry, import, transaction, transfer, user, etc.) with attribute labels, error messages, and model name translations.
Polish Locale Files — Views
config/locales/views/**/pl.yml
Added 60+ Polish locale files for UI views covering accounts, admin functions, investments, bonds, budgets, categories, trades, transactions, reports, settings, and third-party provider integrations (SnapTrade, Plaid, CoinBase, Enable Banking, etc.).
Polish Locale Files — Mailers & Layout
config/locales/{breadcrumbs,doorkeeper,mailers,layout}/pl.yml
Added Polish translations for email templates, navigation breadcrumbs, OAuth authorization UI (Doorkeeper), and application layout components.
Locale Audit Tooling & Documentation
script/locale_audit.rb, script/pl_locale_audit.rb, docs/localization/*
Added generic locale audit Ruby script detecting untranslated English and validating CLDR plural categories, Polish-specific wrapper script, and audit result documentation.
Polish Pluralization & Tests
test/lib/polish_pluralization_test.rb, test/lib/money_test.rb
Added new test case for Polish i18n plural rules (one, few, many, other) and updated Money formatting test to use LanguagesHelper::SUPPORTED_LOCALES.
I18n Interpolation Fixes
app/controllers/snaptrade_items_controller.rb, app/views/import/confirms/show.html.erb, app/views/subscriptions/upgrade.html.erb, config/locales/views/snaptrade_items/{de,en,es}.yml
Updated SnapTrade account-linking controller and view to pass count and failed_count instead of linked/failed for proper pluralization; updated German, English, and Spanish locale messages to pluralize success/failure counts accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • jjmata

Poem

🐰 Hop hop, Polish words take flight,
Ninety files shine bright and right,
Plurals dance in few and many,
Translations ready—don't lack any!
Rails i18n whispers: "Cześć, friend!" 🇵🇱

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 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 main change: adding comprehensive Polish localization support, fixing pluralization rules, and introducing reusable locale audit tooling.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@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: e8211e6bfc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread script/locale_audit.rb Outdated

Copilot AI 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.

Pull request overview

Finalizes Polish (pl) localization across the Rails app, adds rails-i18n for runtime pluralization rules, and introduces reusable locale QA tooling + reports to validate translation completeness and pluralization consistency.

Changes:

  • Added pl to supported locales, introduced rails-i18n, and expanded locale-aware money formatting coverage.
  • Added broad Polish translation coverage across views/models/mailers + Doorkeeper.
  • Added locale audit scripts, localization docs, and generated Polish audit reports.

Reviewed changes

Copilot reviewed 98 out of 99 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
test/lib/polish_pluralization_test.rb Adds a focused test verifying Polish pluralization behavior via rails-i18n.
test/lib/money_test.rb Ensures pl is included in the supported-locales money formatting smoke test.
script/pl_locale_audit.rb Backward-compatible wrapper for running the generic audit script for Polish.
script/locale_audit.rb Adds a locale audit tool for scanning locale YAMLs for suspicious English and pluralization issues.
Gemfile Adds rails-i18n dependency.
Gemfile.lock Locks rails-i18n into the bundle.
docs/localization/README.md Documents the localization audit toolkit and how to run it.
docs/localization/pl_production_readiness.md Generated readiness report for Polish locale files.
docs/localization/pl_pluralization_audit.md Generated pluralization audit report for Polish locale files.
config/locales/views/vehicles/pl.yml Adds Polish translations for vehicle views.
config/locales/views/valuations/pl.yml Adds Polish translations for valuation views.
config/locales/views/users/pl.yml Adds Polish translations for user flows and notices.
config/locales/views/transfers/pl.yml Adds Polish translations for transfer flows.
config/locales/views/transactions/pl.yml Adds Polish translations for transaction UI (including plural blocks).
config/locales/views/trades/pl.yml Adds Polish translations for trade views.
config/locales/views/tags/pl.yml Adds Polish translations for tags UI.
config/locales/views/tag/deletions/pl.yml Adds Polish translations for tag deletion flow.
config/locales/views/subscriptions/pl.yml Adds Polish translations for subscription/upgrade UI.
config/locales/views/splits/pl.yml Adds Polish translations for split-transaction UI.
config/locales/views/snaptrade_items/pl.yml Adds Polish translations for SnapTrade integration UI.
config/locales/views/simplefin_items/pl.yml Adds Polish translations for SimpleFIN integration UI.
config/locales/views/shared/pl.yml Adds Polish translations for shared UI elements (confirm modal, etc.).
config/locales/views/settings/sso_identities/pl.yml Adds Polish translations for SSO identity settings.
config/locales/views/settings/securities/pl.yml Adds Polish translations for security/MFA settings.
config/locales/views/settings/pl.yml Adds Polish translations for settings screens and provider UI.
config/locales/views/settings/hostings/pl.yml Adds Polish translations for self-hosting settings screens.
config/locales/views/settings/api_keys/pl.yml Adds Polish translations for API key management UI.
config/locales/views/sessions/pl.yml Adds Polish translations for login/session flows.
config/locales/views/securities/pl.yml Adds Polish translations for securities combobox display.
config/locales/views/rules/pl.yml Adds Polish translations for rules UI.
config/locales/views/reports/pl.yml Adds Polish translations for reports UI.
config/locales/views/registrations/pl.yml Adds Polish translations for registration/invite-code flow.
config/locales/views/recurring_transactions/pl.yml Adds Polish translations for recurring transactions UI.
config/locales/views/properties/pl.yml Adds Polish translations for property views.
config/locales/views/plaid_items/pl.yml Adds Polish translations for Plaid integration UI.
config/locales/views/pending_duplicate_merges/pl.yml Adds Polish translations for pending duplicate merge UI.
config/locales/views/pdf_import_mailer/pl.yml Adds Polish translations used by PDF-import mailer views.
config/locales/views/passwords/pl.yml Adds Polish translations for password update UI.
config/locales/views/password_resets/pl.yml Adds Polish translations for password reset UI.
config/locales/views/password_mailer/pl.yml Adds Polish translations for password reset mailer views.
config/locales/views/pages/pl.yml Adds Polish translations for static pages/dashboard strings.
config/locales/views/other_liabilities/pl.yml Adds Polish translations for other liability views.
config/locales/views/other_assets/pl.yml Adds Polish translations for other assets views.
config/locales/views/onboardings/pl.yml Adds Polish translations for onboarding flow.
config/locales/views/oidc_accounts/pl.yml Adds Polish translations for OIDC account linking/creation UI.
config/locales/views/mfa/pl.yml Adds Polish translations for MFA setup/verification flows.
config/locales/views/mercury_items/pl.yml Adds Polish translations for Mercury integration UI.
config/locales/views/merchants/pl.yml Adds Polish translations for merchants UI.
config/locales/views/lunchflow_items/pl.yml Adds Polish translations for Lunch Flow integration UI.
config/locales/views/loans/pl.yml Adds Polish translations for loan views.
config/locales/views/layout/pl.yml Adds Polish translations for layout/navigation UI.
config/locales/views/invite_codes/pl.yml Adds Polish translations for invite codes UI.
config/locales/views/invitations/pl.yml Adds Polish translations for invitation UI.
config/locales/views/invitation_mailer/pl.yml Adds Polish translations for invitation mailer views.
config/locales/views/investments/pl.yml Adds Polish translations for investments views.
config/locales/views/indexa_capital_items/pl.yml Adds Polish translations for IndexaCapital integration UI.
config/locales/views/imports/pl.yml Adds Polish translations for import flows (CSV/QIF/NDJSON/PDF).
config/locales/views/impersonation_sessions/pl.yml Adds Polish translations for impersonation session UI.
config/locales/views/holdings/pl.yml Adds Polish translations for holdings UI.
config/locales/views/family_exports/pl.yml Adds Polish translations for family exports UI.
config/locales/views/entries/pl.yml Adds Polish translations for entries UI.
config/locales/views/enable_banking_items/pl.yml Adds Polish translations for Enable Banking integration UI.
config/locales/views/email_confirmation_mailer/pl.yml Adds Polish translations for email-confirmation mailer views.
config/locales/views/depositories/pl.yml Adds Polish translations for depository views.
config/locales/views/cryptos/pl.yml Adds Polish translations for crypto views.
config/locales/views/credit_cards/pl.yml Adds Polish translations for credit card views.
config/locales/views/components/pl.yml Adds Polish translations for shared components (sync summary, etc.).
config/locales/views/coinstats_items/pl.yml Adds Polish translations for CoinStats integration UI.
config/locales/views/coinbase_items/pl.yml Adds Polish translations for Coinbase integration UI.
config/locales/views/chats/pl.yml Adds Polish translations for chat demo banner messaging.
config/locales/views/category/dropdowns/pl.yml Adds Polish translations for category dropdown UI.
config/locales/views/category/deletions/pl.yml Adds Polish translations for category deletion flow.
config/locales/views/categories/pl.yml Adds Polish translations for categories UI.
config/locales/views/budgets/pl.yml Adds Polish translations for budgets UI.
config/locales/views/bonds/pl.yml Adds Polish translations for bonds UI.
config/locales/views/application/pl.yml Adds Polish number/currency formatting defaults.
config/locales/views/admin/users/pl.yml Adds Polish translations for admin user management UI.
config/locales/views/admin/sso_providers/pl.yml Adds Polish translations for admin SSO providers UI.
config/locales/views/admin/invitations/pl.yml Adds Polish translations for admin invitation management.
config/locales/views/accounts/pl.yml Adds Polish translations for accounts UI.
config/locales/views/account_sharings/pl.yml Adds Polish translations for account sharing UI.
config/locales/models/user/pl.yml Adds Polish translations for user model attributes/errors.
config/locales/models/trend/pl.yml Adds Polish translations for trend validation errors.
config/locales/models/transfer/pl.yml Adds Polish translations for transfer validation errors/names.
config/locales/models/transaction/pl.yml Adds Polish translations for transaction attachment errors.
config/locales/models/time_series/value/pl.yml Adds Polish translations for time series value validation errors.
config/locales/models/provider_warnings/pl.yml Adds Polish translations for provider warning messaging.
config/locales/models/import/pl.yml Adds Polish translations for import model attributes/errors.
config/locales/models/entry/pl.yml Adds Polish translations for entry model errors.
config/locales/models/coinstats_item/pl.yml Adds Polish translations for CoinStats syncer statuses.
config/locales/models/coinbase_account/pl.yml Adds Polish translations for Coinbase processor text.
config/locales/models/category/pl.yml Adds Polish translations for category model names.
config/locales/models/address/pl.yml Adds Polish translations for address attributes/format.
config/locales/models/account/pl.yml Adds Polish translations for account model attributes/types.
config/locales/mailers/pdf_import_mailer/pl.yml Adds Polish mailer subject for PDF import mailer.
config/locales/mailers/invitation_mailer/pl.yml Adds Polish mailer subject for invitation mailer.
config/locales/doorkeeper.pl.yml Adds Polish translations for Doorkeeper UI/errors.
config/locales/breadcrumbs/pl.yml Adds Polish translations for breadcrumbs.
app/helpers/languages_helper.rb Adds pl to SUPPORTED_LOCALES.

Comment thread docs/localization/README.md Outdated
Comment thread app/helpers/languages_helper.rb Outdated
Comment thread script/locale_audit.rb Outdated
Comment thread script/locale_audit.rb Outdated
Comment thread script/locale_audit.rb Outdated
Comment thread script/locale_audit.rb Outdated
Comment thread script/locale_audit.rb Outdated
Comment thread config/locales/views/settings/hostings/pl.yml Outdated
Comment thread config/locales/views/snaptrade_items/pl.yml Outdated

@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: 12

🧹 Nitpick comments (8)
config/locales/views/snaptrade_items/pl.yml (1)

23-23: Avoid konto(a) fallback text; use count-aware phrasing.
Połączono %{linked} konto(a) is not natural Polish. Prefer pluralized keys (or separate translated fragments) for linked/failed counts.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/locales/views/snaptrade_items/pl.yml` at line 23, The partial_success
translation uses the unnatural fallback "konto(a)"; replace this single string
with count-aware pluralized keys instead: introduce pluralization entries for
the partial_success message (e.g., partial_success.one, partial_success.other or
use nested keys partial_success.linked.one/other and
partial_success.failed.one/other) and change interpolation to pass numeric
counts (e.g., %{linked_count} and %{failed_count}) so the view can render the
correct Polish singular/plural form; update the translation for the key
referenced as partial_success and the placeholders %{linked}/%{failed} to use
the new count-aware keys.
test/lib/money_test.rb (1)

162-165: Avoid duplicating locale source of truth in test data.

The test comment references LanguagesHelper::SUPPORTED_LOCALES, but the list is hardcoded. Pull from the constant to prevent drift.

♻️ Suggested refactor
-    supported_locales = %w[en fr de es tr nb ca ro pl pt-BR zh-CN zh-TW nl]
+    supported_locales = Array(LanguagesHelper::SUPPORTED_LOCALES).map(&:to_s)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/lib/money_test.rb` around lines 162 - 165, The test is hardcoding the
locale list instead of using the single source of truth; update the test in the
"all supported locales can format money without errors" block to assign
supported_locales from LanguagesHelper::SUPPORTED_LOCALES (or its exported
constant) rather than the literal array so the test always reflects the
canonical list; ensure any required namespace or helper is required/imported so
the constant is accessible in the test.
docs/localization/README.md (1)

29-29: Minor spacing inconsistency in filename pattern.

The pattern *. <locale>.yml has an unusual space before the dot. Consider whether this should be *.<locale>.yml or *.‹locale›.yml for clarity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/localization/README.md` at line 29, The README line describing filename
patterns contains a spacing typo: "`*. <locale>.yml`" should be corrected to
remove the stray space so the pattern reads "`*.<locale>.yml`" (or use a clearer
variant like "`*.‹locale›.yml`") — update that string in
docs/localization/README.md to use the corrected pattern wherever `*.
<locale>.yml` appears.
config/locales/views/holdings/pl.yml (1)

82-86: Use one consistent Polish term for “cost basis.”

This section switches terminology from earlier koszt bazowy to podstawa kosztowa. Consider standardizing to one term across the file.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/locales/views/holdings/pl.yml` around lines 82 - 86, The Polish
translations in keys cost_basis_locked_label, cost_basis_locked_description,
unlock_cost_basis, unlock_confirm_title, and unlock_confirm_body use mixed terms
("podstawa kosztowa" vs "koszt bazowy"); pick one canonical term (e.g.,
"podstawa kosztowa") and update all these values to use that single term
consistently, ensuring phrasing and grammar remain correct after the
replacement.
config/locales/views/lunchflow_items/pl.yml (1)

145-145: Use plural forms instead of konto/kont fallback.

Line 145 should use one/few/many/other for natural Polish output and consistency with the rest of this file.

♻️ Proposed refactor
     complete_account_setup:
       all_skipped: Wszystkie konta zostały pominięte. Nie utworzono żadnych kont.
       creation_failed: 'Nie udało się utworzyć kont: %{error}'
       no_accounts: Brak kont do skonfigurowania.
-      success: Pomyślnie utworzono %{count} konto/kont.
+      success:
+        one: Pomyślnie utworzono %{count} konto.
+        few: Pomyślnie utworzono %{count} konta.
+        many: Pomyślnie utworzono %{count} kont.
+        other: Pomyślnie utworzono %{count} konta.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/locales/views/lunchflow_items/pl.yml` at line 145, Replace the
fallback "konto/kont" with proper Polish pluralization entries for the
translation key "success" so it uses plural forms (one, few, many, other) and
still interpolates %{count}; update the "success" entry (the string currently
"Pomyślnie utworzono %{count} konto/kont.") to a mapping with keys
one/few/many/other containing correctly inflected phrases (e.g., singular and
the appropriate plural forms) so Rails I18n will pick the right form based on
count.
config/locales/views/coinstats_items/pl.yml (1)

16-16: Pluralize link_wallet.success for correct Polish grammar.

Line 16 currently hardcodes one form (portfeli), which is incorrect for e.g. 1 and 2-4.

♻️ Proposed refactor
     link_wallet:
-      success: "Pomyślnie połączono %{count} portfeli kryptowalutowych."
+      success:
+        one: "Pomyślnie połączono %{count} portfel kryptowalutowy."
+        few: "Pomyślnie połączono %{count} portfele kryptowalutowe."
+        many: "Pomyślnie połączono %{count} portfeli kryptowalutowych."
+        other: "Pomyślnie połączono %{count} portfela kryptowalutowego."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/locales/views/coinstats_items/pl.yml` at line 16, Replace the single
hardcoded string for link_wallet.success with a Polish pluralized set (use I18n
plural keys) so counts 1, 2-4 and other values use correct grammar; e.g. provide
keys like one ("Pomyślnie połączono %{count} portfel kryptowalutowy."), few
("Pomyślnie połączono %{count} portfele kryptowalutowe.") and other ("Pomyślnie
połączono %{count} portfeli kryptowalutowych.") under link_wallet.success so
Rails will pick the correct form for different %{count} values.
config/locales/views/mercury_items/pl.yml (1)

149-149: Replace konto/kont with plural keys.

Line 149 should follow one/few/many/other to keep Polish grammar correct and align with the rest of the file.

♻️ Proposed refactor
     complete_account_setup:
       all_skipped: Wszystkie konta zostały pominięte. Nie utworzono żadnych kont.
       creation_failed: 'Nie udało się utworzyć kont: %{error}'
       no_accounts: Brak kont do skonfigurowania.
-      success: Pomyślnie utworzono %{count} konto/kont.
+      success:
+        one: Pomyślnie utworzono %{count} konto.
+        few: Pomyślnie utworzono %{count} konta.
+        many: Pomyślnie utworzono %{count} kont.
+        other: Pomyślnie utworzono %{count} konta.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/locales/views/mercury_items/pl.yml` at line 149, The current
translation uses a single string "success: Pomyślnie utworzono %{count}
konto/kont." which breaks Polish pluralization; replace the scalar value for the
success key with pluralized subkeys (one, few, many, other) for the
mercury_items success string so Rails I18n can pick the right form — e.g.
provide one: "Pomyślnie utworzono %{count} konto.", few: "Pomyślnie utworzono
%{count} konta.", many/other: "Pomyślnie utworzono %{count} kont." and keep
%{count} intact. Ensure the change targets the same success key in the
mercury_items locale block.
config/locales/views/bonds/pl.yml (1)

72-72: Optional: de-duplicate repeated not_bond_account string.

The same Polish message is defined in two places; consider centralizing it to reduce drift risk during future edits.

Also applies to: 154-154

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/locales/views/bonds/pl.yml` at line 72, The Polish locale key
not_bond_account is duplicated; remove the repeated entry by centralizing the
message into a single shared locale key (e.g., move the not_bond_account
definition into the common/shared translations file or top-level bonds locale)
and update the other occurrence to use that single definition so there is only
one source of truth for not_bond_account; ensure keys remain identical and run
the i18n/locale linter to confirm no missing references.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config/locales/models/account/pl.yml`:
- Around line 14-22: The locale keys for Account subtypes are misaligned: rename
account/credit to account/credit_card and add the missing account/crypto key so
translations match the Rails delegated subtypes (Depository, Investment, Crypto,
Property, Vehicle, OtherAsset, CreditCard, Loan, OtherLiability); update the
YAML block that contains account/depository, account/investment,
account/property, account/vehicle, account/other_asset, account/other_liability,
account/loan to include account/credit_card and account/crypto with appropriate
Polish labels (e.g., "Karta kredytowa" for credit_card and a suitable Polish
term for crypto) so runtime lookups won't fall back to untranslated keys.

In `@config/locales/models/coinstats_item/pl.yml`:
- Line 8: The wallets_need_setup translation currently uses a single
interpolated string with %{count}, which breaks Polish pluralization; replace it
with pluralization keys (one/few/many/other) for the wallets_need_setup key so
the correct form is selected based on count (e.g. provide distinct strings for
one, few, many, other) and keep %{count} interpolation in each form and an
"other" fallback.

In `@config/locales/views/enable_banking_items/pl.yml`:
- Line 20: The Polish locale string for count-based success messages must be
pluralized: replace the single `success: Pomyślnie utworzono %{count} kont!`
entry with a pluralized mapping for the keys `complete_account_setup.success`
and `link_accounts.success` using Polish plural categories (one, few, many,
other) so the controller-provided `count` is rendered with correct grammar; add
appropriate Polish text for each category (e.g., singular, few, many, other)
under the `success` key for both message keys.

In `@config/locales/views/imports/pl.yml`:
- Around line 77-83: Replace the hardcoded product name "Maybe" in the
translation values for keys account_mapping_description,
account_type_mapping_description, category_mapping_description, and
tag_mapping_description with an interpolation placeholder (e.g., %{product});
then update the places that call t(...) for these keys to pass the current
product name as the product: product_name parameter so the branding is
configurable and consistent (search for usages of these keys in the
import/mapping UI components and add product: currentProduct or equivalent when
invoking t()).

In `@config/locales/views/indexa_capital_items/pl.yml`:
- Line 241: complete_account_setup.success currently uses a single string with
%{count}; update it to use Polish pluralization forms (one, few, many, other) so
the message picks the correct form based on the %{count} variable. Replace the
single value for complete_account_setup.success with a pluralized map containing
keys "one", "few", "many", and "other", each including %{count} and the
correctly inflected noun (e.g., "konto", "konta", "kont") matching the
repository's existing pattern (see similar pluralized keys in snaptrade_items
and coinbase_items) so Rails I18n will select the right form.

In `@config/locales/views/pdf_import_mailer/pl.yml`:
- Line 6: Replace the inconsistent interpolation token %{product} in the intro
translation with %{product_name} and update callers to pass product_name as the
interpolation key (i.e., ensure t(..., product_name: product_name) is used in
the mailer that renders this translation, such as the PDF import mailer invoking
t for the intro string) so the translation and mailer use the same branding
parameter.

In `@config/locales/views/settings/pl.yml`:
- Line 177: The translation string step1_html contains an external anchor with
target="_blank" that should be hardened; update the step1_html value so the
anchor includes rel="noopener noreferrer" (i.e., modify the HTML in the
step1_html key to add rel="noopener noreferrer" to the <a> tag) to prevent
tab-nabbing and ensure safe external links.
- Line 154: Replace the English string for the locale key self_hosting_label
with its Polish translation; specifically update the value for
self_hosting_label from "Self-Hosting" to an appropriate Polish label (e.g.,
"Hosting własny" or "Hostowanie we własnym zakresie") so the Polish locale file
contains the translated UI text.

In `@config/locales/views/snaptrade_items/pl.yml`:
- Line 54: Replace the repeated misspelling "Osierocoła" with the correct form
"Osierocona" in the Polish locale entries for the orphaned-registration
messages; locate the affected string keys in
config/locales/views/snaptrade_items/pl.yml (the user-visible success/error
messages that currently contain "Osierocoła") and update each occurrence
(including the ones noted around the other lines) so the displayed text
consistently uses "Osierocona".
- Line 118: The provider copy in the snaptrade_items locale uses ASCII-only
variants instead of Polish diacritics; update the YAML values for the
description and the other affected keys (the description under snaptrade_items
and the strings referenced at the nearby lines 126-127 and 129-130) to use
proper Polish characters (e.g., "laczy" -> "łączy", "glownymi" -> "głównymi",
"Wprowadz" -> "Wprowadź", "zaktualizowac" -> "zaktualizować") so all
provider-facing strings are consistently normalized with Polish diacritics.

In `@config/locales/views/subscriptions/pl.yml`:
- Line 13: Replace the flat "trialing: \"Twoje dane zostaną usunięte za %{days}
dni\"" string with i18n pluralization keys using %{count} (e.g. trialing: one:
"...%{count} dzień", few: "...%{count} dni", many: "...%{count} dni", other:
"...%{count} dni") so Polish singular/few/many forms are correct, and ensure
callers use I18n.t("views.subscriptions.trialing", count: days) (or equivalent)
instead of passing %{days} directly.

In `@script/pl_locale_audit.rb`:
- Around line 7-8: Filter out any user-supplied locale arguments from ARGV
before building args so the wrapper's "--locale", "pl" cannot be overridden:
remove both the separate flag form ("--locale" followed by a value) and the
combined form ("--locale=...") from ARGV, then set args = ["--locale", "pl"] +
filtered_argv and call exec("ruby", "script/locale_audit.rb", *args) as before;
operate on the existing args variable and ARGV referenced in the file to locate
and apply the change.

---

Nitpick comments:
In `@config/locales/views/bonds/pl.yml`:
- Line 72: The Polish locale key not_bond_account is duplicated; remove the
repeated entry by centralizing the message into a single shared locale key
(e.g., move the not_bond_account definition into the common/shared translations
file or top-level bonds locale) and update the other occurrence to use that
single definition so there is only one source of truth for not_bond_account;
ensure keys remain identical and run the i18n/locale linter to confirm no
missing references.

In `@config/locales/views/coinstats_items/pl.yml`:
- Line 16: Replace the single hardcoded string for link_wallet.success with a
Polish pluralized set (use I18n plural keys) so counts 1, 2-4 and other values
use correct grammar; e.g. provide keys like one ("Pomyślnie połączono %{count}
portfel kryptowalutowy."), few ("Pomyślnie połączono %{count} portfele
kryptowalutowe.") and other ("Pomyślnie połączono %{count} portfeli
kryptowalutowych.") under link_wallet.success so Rails will pick the correct
form for different %{count} values.

In `@config/locales/views/holdings/pl.yml`:
- Around line 82-86: The Polish translations in keys cost_basis_locked_label,
cost_basis_locked_description, unlock_cost_basis, unlock_confirm_title, and
unlock_confirm_body use mixed terms ("podstawa kosztowa" vs "koszt bazowy");
pick one canonical term (e.g., "podstawa kosztowa") and update all these values
to use that single term consistently, ensuring phrasing and grammar remain
correct after the replacement.

In `@config/locales/views/lunchflow_items/pl.yml`:
- Line 145: Replace the fallback "konto/kont" with proper Polish pluralization
entries for the translation key "success" so it uses plural forms (one, few,
many, other) and still interpolates %{count}; update the "success" entry (the
string currently "Pomyślnie utworzono %{count} konto/kont.") to a mapping with
keys one/few/many/other containing correctly inflected phrases (e.g., singular
and the appropriate plural forms) so Rails I18n will pick the right form based
on count.

In `@config/locales/views/mercury_items/pl.yml`:
- Line 149: The current translation uses a single string "success: Pomyślnie
utworzono %{count} konto/kont." which breaks Polish pluralization; replace the
scalar value for the success key with pluralized subkeys (one, few, many, other)
for the mercury_items success string so Rails I18n can pick the right form —
e.g. provide one: "Pomyślnie utworzono %{count} konto.", few: "Pomyślnie
utworzono %{count} konta.", many/other: "Pomyślnie utworzono %{count} kont." and
keep %{count} intact. Ensure the change targets the same success key in the
mercury_items locale block.

In `@config/locales/views/snaptrade_items/pl.yml`:
- Line 23: The partial_success translation uses the unnatural fallback
"konto(a)"; replace this single string with count-aware pluralized keys instead:
introduce pluralization entries for the partial_success message (e.g.,
partial_success.one, partial_success.other or use nested keys
partial_success.linked.one/other and partial_success.failed.one/other) and
change interpolation to pass numeric counts (e.g., %{linked_count} and
%{failed_count}) so the view can render the correct Polish singular/plural form;
update the translation for the key referenced as partial_success and the
placeholders %{linked}/%{failed} to use the new count-aware keys.

In `@docs/localization/README.md`:
- Line 29: The README line describing filename patterns contains a spacing typo:
"`*. <locale>.yml`" should be corrected to remove the stray space so the pattern
reads "`*.<locale>.yml`" (or use a clearer variant like "`*.‹locale›.yml`") —
update that string in docs/localization/README.md to use the corrected pattern
wherever `*. <locale>.yml` appears.

In `@test/lib/money_test.rb`:
- Around line 162-165: The test is hardcoding the locale list instead of using
the single source of truth; update the test in the "all supported locales can
format money without errors" block to assign supported_locales from
LanguagesHelper::SUPPORTED_LOCALES (or its exported constant) rather than the
literal array so the test always reflects the canonical list; ensure any
required namespace or helper is required/imported so the constant is accessible
in the test.
🪄 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: c2bdb579-28a0-4727-a10b-dff234136bc7

📥 Commits

Reviewing files that changed from the base of the PR and between d49e74b and e8211e6.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (98)
  • Gemfile
  • app/helpers/languages_helper.rb
  • config/locales/breadcrumbs/pl.yml
  • config/locales/doorkeeper.pl.yml
  • config/locales/mailers/invitation_mailer/pl.yml
  • config/locales/mailers/pdf_import_mailer/pl.yml
  • config/locales/models/account/pl.yml
  • config/locales/models/address/pl.yml
  • config/locales/models/category/pl.yml
  • config/locales/models/coinbase_account/pl.yml
  • config/locales/models/coinstats_item/pl.yml
  • config/locales/models/entry/pl.yml
  • config/locales/models/import/pl.yml
  • config/locales/models/provider_warnings/pl.yml
  • config/locales/models/time_series/value/pl.yml
  • config/locales/models/transaction/pl.yml
  • config/locales/models/transfer/pl.yml
  • config/locales/models/trend/pl.yml
  • config/locales/models/user/pl.yml
  • config/locales/views/account_sharings/pl.yml
  • config/locales/views/accounts/pl.yml
  • config/locales/views/admin/invitations/pl.yml
  • config/locales/views/admin/sso_providers/pl.yml
  • config/locales/views/admin/users/pl.yml
  • config/locales/views/application/pl.yml
  • config/locales/views/bonds/pl.yml
  • config/locales/views/budgets/pl.yml
  • config/locales/views/categories/pl.yml
  • config/locales/views/category/deletions/pl.yml
  • config/locales/views/category/dropdowns/pl.yml
  • config/locales/views/chats/pl.yml
  • config/locales/views/coinbase_items/pl.yml
  • config/locales/views/coinstats_items/pl.yml
  • config/locales/views/components/pl.yml
  • config/locales/views/credit_cards/pl.yml
  • config/locales/views/cryptos/pl.yml
  • config/locales/views/depositories/pl.yml
  • config/locales/views/email_confirmation_mailer/pl.yml
  • config/locales/views/enable_banking_items/pl.yml
  • config/locales/views/entries/pl.yml
  • config/locales/views/family_exports/pl.yml
  • config/locales/views/holdings/pl.yml
  • config/locales/views/impersonation_sessions/pl.yml
  • config/locales/views/imports/pl.yml
  • config/locales/views/indexa_capital_items/pl.yml
  • config/locales/views/investments/pl.yml
  • config/locales/views/invitation_mailer/pl.yml
  • config/locales/views/invitations/pl.yml
  • config/locales/views/invite_codes/pl.yml
  • config/locales/views/layout/pl.yml
  • config/locales/views/loans/pl.yml
  • config/locales/views/lunchflow_items/pl.yml
  • config/locales/views/merchants/pl.yml
  • config/locales/views/mercury_items/pl.yml
  • config/locales/views/mfa/pl.yml
  • config/locales/views/oidc_accounts/pl.yml
  • config/locales/views/onboardings/pl.yml
  • config/locales/views/other_assets/pl.yml
  • config/locales/views/other_liabilities/pl.yml
  • config/locales/views/pages/pl.yml
  • config/locales/views/password_mailer/pl.yml
  • config/locales/views/password_resets/pl.yml
  • config/locales/views/passwords/pl.yml
  • config/locales/views/pdf_import_mailer/pl.yml
  • config/locales/views/pending_duplicate_merges/pl.yml
  • config/locales/views/plaid_items/pl.yml
  • config/locales/views/properties/pl.yml
  • config/locales/views/recurring_transactions/pl.yml
  • config/locales/views/registrations/pl.yml
  • config/locales/views/reports/pl.yml
  • config/locales/views/rules/pl.yml
  • config/locales/views/securities/pl.yml
  • config/locales/views/sessions/pl.yml
  • config/locales/views/settings/api_keys/pl.yml
  • config/locales/views/settings/hostings/pl.yml
  • config/locales/views/settings/pl.yml
  • config/locales/views/settings/securities/pl.yml
  • config/locales/views/settings/sso_identities/pl.yml
  • config/locales/views/shared/pl.yml
  • config/locales/views/simplefin_items/pl.yml
  • config/locales/views/snaptrade_items/pl.yml
  • config/locales/views/splits/pl.yml
  • config/locales/views/subscriptions/pl.yml
  • config/locales/views/tag/deletions/pl.yml
  • config/locales/views/tags/pl.yml
  • config/locales/views/trades/pl.yml
  • config/locales/views/transactions/pl.yml
  • config/locales/views/transfers/pl.yml
  • config/locales/views/users/pl.yml
  • config/locales/views/valuations/pl.yml
  • config/locales/views/vehicles/pl.yml
  • docs/localization/README.md
  • docs/localization/pl_pluralization_audit.md
  • docs/localization/pl_production_readiness.md
  • script/locale_audit.rb
  • script/pl_locale_audit.rb
  • test/lib/money_test.rb
  • test/lib/polish_pluralization_test.rb

Comment thread config/locales/models/account/pl.yml
Comment thread config/locales/models/coinstats_item/pl.yml Outdated
Comment thread config/locales/views/enable_banking_items/pl.yml Outdated
Comment thread config/locales/views/imports/pl.yml Outdated
Comment thread config/locales/views/indexa_capital_items/pl.yml Outdated
Comment thread config/locales/views/settings/pl.yml Outdated
Comment thread config/locales/views/snaptrade_items/pl.yml Outdated
Comment thread config/locales/views/snaptrade_items/pl.yml Outdated
Comment thread config/locales/views/subscriptions/pl.yml Outdated
Comment thread script/pl_locale_audit.rb Outdated

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/controllers/snaptrade_items_controller.rb`:
- Around line 224-228: The controller now calls nested translation keys
t(".partial_success.linked", ...) and t(".partial_success.failed", ...) which
don't exist in English/German/Spanish locales; revert to using the original flat
key by replacing the two nested t(...) calls and the composite
t(".partial_success.template", ...) with a single call to t(".partial_success",
linked: linked_message, failed: failed_message, default: "Linked #{linked_count}
account(s). #{errors.size} failed to link.") so it uses the existing flat locale
entries; update the expressions that build linked_message and failed_message
(linked_message, failed_message) and the t(".partial_success") usage in
SnaptradeItemsController to match this single-key format.

In `@app/views/subscriptions/upgrade.html.erb`:
- Line 28: The template change uses count-based interpolation for the
translation key "subscriptions.upgrade.trialing" (in
app/views/subscriptions/upgrade.html.erb) passing count:
Current.family.days_left_in_trial; update all affected locale entries (English,
French, German, Dutch, Spanish, Portuguese (BR), Catalan, Simplified Chinese,
Traditional Chinese, Turkish, Romanian, Norwegian) to use %{count} (and
appropriate plural forms) instead of %{days}, or alternatively revert the
template to pass days: Current.family.days_left_in_trial and ensure only the
Polish pluralized entry remains untouched; pick one approach and make the locale
keys consistent with the template's interpolation and pluralization strategy.
🪄 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: 758532e1-0db9-4d79-9de6-a40b3a9b351e

📥 Commits

Reviewing files that changed from the base of the PR and between e8211e6 and 2cd684e.

📒 Files selected for processing (26)
  • app/controllers/snaptrade_items_controller.rb
  • app/helpers/languages_helper.rb
  • app/views/import/confirms/show.html.erb
  • app/views/pdf_import_mailer/next_steps.html.erb
  • app/views/pdf_import_mailer/next_steps.text.erb
  • app/views/subscriptions/upgrade.html.erb
  • config/locales/models/account/pl.yml
  • config/locales/models/coinstats_item/pl.yml
  • config/locales/views/bonds/pl.yml
  • config/locales/views/coinstats_items/pl.yml
  • config/locales/views/enable_banking_items/pl.yml
  • config/locales/views/imports/pl.yml
  • config/locales/views/indexa_capital_items/pl.yml
  • config/locales/views/lunchflow_items/pl.yml
  • config/locales/views/mercury_items/pl.yml
  • config/locales/views/pdf_import_mailer/pl.yml
  • config/locales/views/settings/hostings/pl.yml
  • config/locales/views/settings/pl.yml
  • config/locales/views/snaptrade_items/pl.yml
  • config/locales/views/subscriptions/pl.yml
  • docs/localization/README.md
  • docs/localization/pl_pluralization_audit.md
  • docs/localization/pl_production_readiness.md
  • script/locale_audit.rb
  • script/pl_locale_audit.rb
  • test/lib/money_test.rb
✅ Files skipped from review due to trivial changes (19)
  • app/views/pdf_import_mailer/next_steps.html.erb
  • docs/localization/pl_pluralization_audit.md
  • config/locales/views/subscriptions/pl.yml
  • config/locales/models/coinstats_item/pl.yml
  • docs/localization/pl_production_readiness.md
  • config/locales/views/pdf_import_mailer/pl.yml
  • config/locales/models/account/pl.yml
  • config/locales/views/enable_banking_items/pl.yml
  • config/locales/views/settings/hostings/pl.yml
  • config/locales/views/coinstats_items/pl.yml
  • config/locales/views/settings/pl.yml
  • docs/localization/README.md
  • config/locales/views/lunchflow_items/pl.yml
  • config/locales/views/snaptrade_items/pl.yml
  • config/locales/views/mercury_items/pl.yml
  • config/locales/views/bonds/pl.yml
  • config/locales/views/imports/pl.yml
  • config/locales/views/indexa_capital_items/pl.yml
  • script/locale_audit.rb
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/lib/money_test.rb
  • script/pl_locale_audit.rb

Comment thread app/controllers/snaptrade_items_controller.rb Outdated
Comment thread app/views/subscriptions/upgrade.html.erb Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 103 out of 104 changed files in this pull request and generated 7 comments.

Comment thread app/views/subscriptions/upgrade.html.erb Outdated
Comment thread app/controllers/snaptrade_items_controller.rb Outdated
Comment thread script/locale_audit.rb Outdated
Comment thread config/locales/views/settings/hostings/pl.yml
Comment thread config/locales/views/settings/hostings/pl.yml Outdated
Comment thread config/locales/views/settings/hostings/pl.yml Outdated
Comment thread config/locales/views/settings/hostings/pl.yml Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 103 out of 104 changed files in this pull request and generated 4 comments.

Comment thread config/locales/views/settings/hostings/pl.yml
Comment thread config/locales/views/settings/hostings/pl.yml Outdated
Comment thread config/locales/views/settings/hostings/pl.yml
Comment thread script/pl_locale_audit.rb Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 103 out of 104 changed files in this pull request and generated 4 comments.

Comment thread config/locales/views/snaptrade_items/pl.yml Outdated
Comment thread config/locales/views/mercury_items/pl.yml Outdated
Comment thread config/locales/views/lunchflow_items/pl.yml Outdated
Comment thread test/lib/polish_pluralization_test.rb Outdated
- Improved partial_success wording in SnapTrade with proper noun inflection
- Fixed typos: Pomin → Pomiń in Mercury and LunchFlow items
- Isolated I18n backend state in polish_pluralization_test to prevent test coupling
@UberDudePL UberDudePL requested a review from Copilot April 3, 2026 00:17
@UberDudePL

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Reviews resumed.

@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.

♻️ Duplicate comments (1)
config/locales/views/snaptrade_items/pl.yml (1)

168-168: ⚠️ Potential issue | 🟡 Minor

Fix a regression typo in orphaned-connection label.

Line 168 reintroduces the typo Osierocoło; it should be Osierocone for correct Polish copy.

✏️ Proposed fix
-      orphaned_connection: Osierocoło połączenie (niezsynchronizowane lokalnie)
+      orphaned_connection: Osierocone połączenie (niezsynchronizowane lokalnie)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/locales/views/snaptrade_items/pl.yml` at line 168, The Polish
translation for the key orphaned_connection contains a typo ("Osierocoło");
update the value for orphaned_connection to the correct phrase "Osierocone
połączenie (niezsynchronizowane lokalnie)" so the YAML key orphaned_connection
has the corrected Polish copy.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@config/locales/views/snaptrade_items/pl.yml`:
- Line 168: The Polish translation for the key orphaned_connection contains a
typo ("Osierocoło"); update the value for orphaned_connection to the correct
phrase "Osierocone połączenie (niezsynchronizowane lokalnie)" so the YAML key
orphaned_connection has the corrected Polish copy.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 09e42f1f-db32-4fe6-a584-44c78b86c476

📥 Commits

Reviewing files that changed from the base of the PR and between 06021a9 and 6cd72ee.

📒 Files selected for processing (4)
  • config/locales/views/lunchflow_items/pl.yml
  • config/locales/views/mercury_items/pl.yml
  • config/locales/views/snaptrade_items/pl.yml
  • test/lib/polish_pluralization_test.rb
✅ Files skipped from review due to trivial changes (2)
  • config/locales/views/lunchflow_items/pl.yml
  • config/locales/views/mercury_items/pl.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/lib/polish_pluralization_test.rb

Copilot AI 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.

Pull request overview

Copilot reviewed 103 out of 104 changed files in this pull request and generated 2 comments.

Comment thread script/pl_locale_audit.rb Outdated
Comment thread script/locale_audit.rb Outdated
- Use RbConfig.ruby instead of 'ruby' to ensure consistent interpreter
- Remove Symbol from permitted_classes and explicitly allow CLDR plural symbols (one, few, many, other) in YAML loading
@UberDudePL UberDudePL force-pushed the feature/pl-translations-clean branch from 353934e to 88e73d4 Compare April 3, 2026 00:29
@UberDudePL UberDudePL requested a review from Copilot April 3, 2026 00:30

Copilot AI 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.

Pull request overview

Copilot reviewed 103 out of 104 changed files in this pull request and generated no new comments.

@jjmata jjmata self-requested a review April 4, 2026 10:18

@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.

Here's Opus 4.6 review, anything you want to follow up on @UberDudePL?


Summary

This PR adds production-ready Polish (pl) localization with ~90 locale files, a reusable locale audit script, and the rails-i18n gem for CLDR pluralization rules. It also modifies several controllers/views to accommodate Polish pluralization patterns.

Review Findings

1. Overly Complex Controller Logic in snaptrade_items_controller.rb (Major)

The complete_account_setup action now has runtime I18n.exists? checks to conditionally build pluralized sub-messages for partial_success. This:

  • Adds significant complexity to a controller for an i18n concern
  • Affects ALL locales at runtime, not just Polish
  • Is fragile — relies on checking key existence at runtime and falling back to raw integers
  • Violates the project convention of skinny controllers

Recommendation: Use a simpler approach — pass count directly into the partial_success translation with standard Rails pluralization, or restructure the English locale to use count-based pluralization too. All locales should use the same interpolation keys.

2. Dual Interpolation Variables in Views (Minor)

Three view files now pass both product and product_name to translation calls:

  • app/views/import/confirms/show.html.erb — adds product: product_name
  • app/views/pdf_import_mailer/next_steps.html.erb — adds product_name: product_name
  • app/views/pdf_import_mailer/next_steps.text.erb — adds product_name: product_name

The English locale uses %{product} while the Polish locale uses %{product_name}. This is a backwards-compatibility shim. The Polish translations should use the same interpolation key (%{product}) as the English locale to avoid this dual-passing pattern.

3. subscriptions/upgrade.html.erb adds count: for pluralization (Minor)

The English trialing key is "Your data will be deleted in %{days} days" — a simple string with no pluralization. The PR adds count: Current.family.days_left_in_trial alongside days: to enable Polish pluralization. This is fine mechanically, but the English locale should also be updated to use count-based pluralization for consistency (e.g., one: / other: forms).

4. Good Changes

  • rails-i18n gem: Correct dependency for CLDR plural rules — necessary for Polish (one/few/many/other)
  • money_test.rb: Using LanguagesHelper::SUPPORTED_LOCALES instead of a hardcoded list is a nice improvement
  • polish_pluralization_test.rb: Validates CLDR rules work correctly for Polish
  • Locale audit tooling (script/locale_audit.rb): Reusable across locales, well-structured
  • Polish translations: Comprehensive coverage of 90+ files with proper pluralization forms
  • Adding "pl" to SUPPORTED_LOCALES: Correctly done, file count comments cleaned up

5. Minor Nits

  • polish_pluralization_test.rb uses I18n.backend.send(:translations) — this accesses a private API. It works but could break on i18n gem updates. Consider using I18n.backend.store_translations for setup and just asserting on I18n.t output (the ensure/restore block can be dropped).
  • script/pl_locale_audit.rb wrapper is ~29 lines to strip --locale and re-exec. Could be a one-liner shell script, but it's fine as-is.

Plan

  1. Post review comments on the PR highlighting the issues above

  2. The main actionable items are:

    • The snaptrade_items_controller.rb complexity should be simplified
    • Polish locale files should use the same interpolation keys as English (%{product} not %{product_name})
    • Consider updating English locale to use pluralized forms for trialing too

@UberDudePL

Copy link
Copy Markdown
Contributor Author

@jjmata

Thanks for the detailed review. I addressed the actionable items and nits as follows:

1. snaptrade_items_controller complexity (Major)

  • Simplified app/controllers/snaptrade_items_controller.rb by removing runtime I18n key existence checks.
  • The controller now passes pluralization inputs directly to translations (count, failed_count) using standard Rails i18n flow.
  • This keeps the controller thinner and removes locale-dependent branching logic from runtime controller code.

2. Interpolation key consistency (%{product} vs %{product_name}) (Minor)

3. Trialing pluralization in English locale (Minor)

4. polish_pluralization_test private API nit

  • Refactored test/lib/polish_pluralization_test.rb to avoid private I18n backend access.
  • The test now uses public API only: store_translations and assertions on I18n.t.
  • Removed manual backend restore logic.

5. pl locale audit wrapper nit

6. SnapTrade locale key alignment

Validation

  • Focused controller tests pass: bin/rails test test/controllers/snaptrade_items_controller_test.rb
  • Polish pluralization test passes: bin/rails test test/lib/polish_pluralization_test.rb

Thanks again for the review.

@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.

There some active discussion on how to handle i18n in a more generalized way, the scripts here might be too narrowly focused. Can we leave them out for now and just take the localization?

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.

These should not be checked in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree, removing

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.

These should not be checked in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree, removing

Comment thread docs/localization/README.md Outdated

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.

These should not be checked in, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree, removing

@UberDudePL

Copy link
Copy Markdown
Contributor Author

@jjmata Removed the files as per the ongoing discussion. I will take a look at it and provide my comments :)

@jjmata jjmata merged commit cebdf1d into we-promise:main Apr 7, 2026
7 checks passed
binarygituser referenced this pull request in binarygituser/sure-dev Apr 26, 2026
…reusable locale audit tooling (#1356)

* Add production-ready Polish localization and reusable locale audit tooling

- add and update Polish locale files across models, views, mailers, and shared translations
- add runtime rails-i18n dependency and Polish locale support in language helper
- add regression coverage for Polish pluralization and locale-aware money formatting
- introduce reusable locale audit script for any locale plus backward-compatible PL wrapper
- add localization audit docs and generated PL readiness/pluralization reports
- resolve one/few/many/other pluralization consistency for Polish locales

* Fix Polish locale review feedback

* Fix locale compatibility regressions

* Polish locale typo pass and wrapper cleanup

* Final language improvements and test isolation for Polish locales

- Improved partial_success wording in SnapTrade with proper noun inflection
- Fixed typos: Pomin → Pomiń in Mercury and LunchFlow items
- Isolated I18n backend state in polish_pluralization_test to prevent test coupling

* Fix code review comments in locale audit scripts

- Use RbConfig.ruby instead of 'ruby' to ensure consistent interpreter
- Remove Symbol from permitted_classes and explicitly allow CLDR plural symbols (one, few, many, other) in YAML loading

* Simplify i18n flow and align locale interpolation keys

* Remove locale audit scripts and localization docs
jaxver pushed a commit to jaxver/sure that referenced this pull request May 31, 2026
…reusable locale audit tooling (we-promise#1356)

* Add production-ready Polish localization and reusable locale audit tooling

- add and update Polish locale files across models, views, mailers, and shared translations
- add runtime rails-i18n dependency and Polish locale support in language helper
- add regression coverage for Polish pluralization and locale-aware money formatting
- introduce reusable locale audit script for any locale plus backward-compatible PL wrapper
- add localization audit docs and generated PL readiness/pluralization reports
- resolve one/few/many/other pluralization consistency for Polish locales

* Fix Polish locale review feedback

* Fix locale compatibility regressions

* Polish locale typo pass and wrapper cleanup

* Final language improvements and test isolation for Polish locales

- Improved partial_success wording in SnapTrade with proper noun inflection
- Fixed typos: Pomin → Pomiń in Mercury and LunchFlow items
- Isolated I18n backend state in polish_pluralization_test to prevent test coupling

* Fix code review comments in locale audit scripts

- Use RbConfig.ruby instead of 'ruby' to ensure consistent interpreter
- Remove Symbol from permitted_classes and explicitly allow CLDR plural symbols (one, few, many, other) in YAML loading

* Simplify i18n flow and align locale interpolation keys

* Remove locale audit scripts and localization docs
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.

3 participants