Polish localization: complete translations, pluralization fixes, and reusable locale audit tooling#1356
Conversation
…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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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
plto supported locales, introducedrails-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. |
There was a problem hiding this comment.
Actionable comments posted: 12
🧹 Nitpick comments (8)
config/locales/views/snaptrade_items/pl.yml (1)
23-23: Avoidkonto(a)fallback text; use count-aware phrasing.
Połączono %{linked} konto(a)is not natural Polish. Prefer pluralized keys (or separate translated fragments) forlinked/failedcounts.🤖 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>.ymlhas an unusual space before the dot. Consider whether this should be*.<locale>.ymlor*.‹locale›.ymlfor 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 bazowytopodstawa 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 ofkonto/kontfallback.Line 145 should use
one/few/many/otherfor 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: Pluralizelink_wallet.successfor correct Polish grammar.Line 16 currently hardcodes one form (
portfeli), which is incorrect for e.g.1and2-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: Replacekonto/kontwith plural keys.Line 149 should follow
one/few/many/otherto 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 repeatednot_bond_accountstring.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
⛔ Files ignored due to path filters (1)
Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (98)
Gemfileapp/helpers/languages_helper.rbconfig/locales/breadcrumbs/pl.ymlconfig/locales/doorkeeper.pl.ymlconfig/locales/mailers/invitation_mailer/pl.ymlconfig/locales/mailers/pdf_import_mailer/pl.ymlconfig/locales/models/account/pl.ymlconfig/locales/models/address/pl.ymlconfig/locales/models/category/pl.ymlconfig/locales/models/coinbase_account/pl.ymlconfig/locales/models/coinstats_item/pl.ymlconfig/locales/models/entry/pl.ymlconfig/locales/models/import/pl.ymlconfig/locales/models/provider_warnings/pl.ymlconfig/locales/models/time_series/value/pl.ymlconfig/locales/models/transaction/pl.ymlconfig/locales/models/transfer/pl.ymlconfig/locales/models/trend/pl.ymlconfig/locales/models/user/pl.ymlconfig/locales/views/account_sharings/pl.ymlconfig/locales/views/accounts/pl.ymlconfig/locales/views/admin/invitations/pl.ymlconfig/locales/views/admin/sso_providers/pl.ymlconfig/locales/views/admin/users/pl.ymlconfig/locales/views/application/pl.ymlconfig/locales/views/bonds/pl.ymlconfig/locales/views/budgets/pl.ymlconfig/locales/views/categories/pl.ymlconfig/locales/views/category/deletions/pl.ymlconfig/locales/views/category/dropdowns/pl.ymlconfig/locales/views/chats/pl.ymlconfig/locales/views/coinbase_items/pl.ymlconfig/locales/views/coinstats_items/pl.ymlconfig/locales/views/components/pl.ymlconfig/locales/views/credit_cards/pl.ymlconfig/locales/views/cryptos/pl.ymlconfig/locales/views/depositories/pl.ymlconfig/locales/views/email_confirmation_mailer/pl.ymlconfig/locales/views/enable_banking_items/pl.ymlconfig/locales/views/entries/pl.ymlconfig/locales/views/family_exports/pl.ymlconfig/locales/views/holdings/pl.ymlconfig/locales/views/impersonation_sessions/pl.ymlconfig/locales/views/imports/pl.ymlconfig/locales/views/indexa_capital_items/pl.ymlconfig/locales/views/investments/pl.ymlconfig/locales/views/invitation_mailer/pl.ymlconfig/locales/views/invitations/pl.ymlconfig/locales/views/invite_codes/pl.ymlconfig/locales/views/layout/pl.ymlconfig/locales/views/loans/pl.ymlconfig/locales/views/lunchflow_items/pl.ymlconfig/locales/views/merchants/pl.ymlconfig/locales/views/mercury_items/pl.ymlconfig/locales/views/mfa/pl.ymlconfig/locales/views/oidc_accounts/pl.ymlconfig/locales/views/onboardings/pl.ymlconfig/locales/views/other_assets/pl.ymlconfig/locales/views/other_liabilities/pl.ymlconfig/locales/views/pages/pl.ymlconfig/locales/views/password_mailer/pl.ymlconfig/locales/views/password_resets/pl.ymlconfig/locales/views/passwords/pl.ymlconfig/locales/views/pdf_import_mailer/pl.ymlconfig/locales/views/pending_duplicate_merges/pl.ymlconfig/locales/views/plaid_items/pl.ymlconfig/locales/views/properties/pl.ymlconfig/locales/views/recurring_transactions/pl.ymlconfig/locales/views/registrations/pl.ymlconfig/locales/views/reports/pl.ymlconfig/locales/views/rules/pl.ymlconfig/locales/views/securities/pl.ymlconfig/locales/views/sessions/pl.ymlconfig/locales/views/settings/api_keys/pl.ymlconfig/locales/views/settings/hostings/pl.ymlconfig/locales/views/settings/pl.ymlconfig/locales/views/settings/securities/pl.ymlconfig/locales/views/settings/sso_identities/pl.ymlconfig/locales/views/shared/pl.ymlconfig/locales/views/simplefin_items/pl.ymlconfig/locales/views/snaptrade_items/pl.ymlconfig/locales/views/splits/pl.ymlconfig/locales/views/subscriptions/pl.ymlconfig/locales/views/tag/deletions/pl.ymlconfig/locales/views/tags/pl.ymlconfig/locales/views/trades/pl.ymlconfig/locales/views/transactions/pl.ymlconfig/locales/views/transfers/pl.ymlconfig/locales/views/users/pl.ymlconfig/locales/views/valuations/pl.ymlconfig/locales/views/vehicles/pl.ymldocs/localization/README.mddocs/localization/pl_pluralization_audit.mddocs/localization/pl_production_readiness.mdscript/locale_audit.rbscript/pl_locale_audit.rbtest/lib/money_test.rbtest/lib/polish_pluralization_test.rb
There was a problem hiding this comment.
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
📒 Files selected for processing (26)
app/controllers/snaptrade_items_controller.rbapp/helpers/languages_helper.rbapp/views/import/confirms/show.html.erbapp/views/pdf_import_mailer/next_steps.html.erbapp/views/pdf_import_mailer/next_steps.text.erbapp/views/subscriptions/upgrade.html.erbconfig/locales/models/account/pl.ymlconfig/locales/models/coinstats_item/pl.ymlconfig/locales/views/bonds/pl.ymlconfig/locales/views/coinstats_items/pl.ymlconfig/locales/views/enable_banking_items/pl.ymlconfig/locales/views/imports/pl.ymlconfig/locales/views/indexa_capital_items/pl.ymlconfig/locales/views/lunchflow_items/pl.ymlconfig/locales/views/mercury_items/pl.ymlconfig/locales/views/pdf_import_mailer/pl.ymlconfig/locales/views/settings/hostings/pl.ymlconfig/locales/views/settings/pl.ymlconfig/locales/views/snaptrade_items/pl.ymlconfig/locales/views/subscriptions/pl.ymldocs/localization/README.mddocs/localization/pl_pluralization_audit.mddocs/localization/pl_production_readiness.mdscript/locale_audit.rbscript/pl_locale_audit.rbtest/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
- 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
|
@coderabbitai resume |
✅ Actions performedReviews resumed. |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
config/locales/views/snaptrade_items/pl.yml (1)
168-168:⚠️ Potential issue | 🟡 MinorFix a regression typo in orphaned-connection label.
Line 168 reintroduces the typo
Osierocoło; it should beOsieroconefor 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
📒 Files selected for processing (4)
config/locales/views/lunchflow_items/pl.ymlconfig/locales/views/mercury_items/pl.ymlconfig/locales/views/snaptrade_items/pl.ymltest/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
- 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
353934e to
88e73d4
Compare
jjmata
left a comment
There was a problem hiding this comment.
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— addsproduct: product_nameapp/views/pdf_import_mailer/next_steps.html.erb— addsproduct_name: product_nameapp/views/pdf_import_mailer/next_steps.text.erb— addsproduct_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-i18ngem: Correct dependency for CLDR plural rules — necessary for Polish (one/few/many/other)money_test.rb: UsingLanguagesHelper::SUPPORTED_LOCALESinstead of a hardcoded list is a nice improvementpolish_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.rbusesI18n.backend.send(:translations)— this accesses a private API. It works but could break on i18n gem updates. Consider usingI18n.backend.store_translationsfor setup and just asserting onI18n.toutput (the ensure/restore block can be dropped).script/pl_locale_audit.rbwrapper is ~29 lines to strip--localeand re-exec. Could be a one-liner shell script, but it's fine as-is.
Plan
-
Post review comments on the PR highlighting the issues above
-
The main actionable items are:
- The
snaptrade_items_controller.rbcomplexity 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
trialingtoo
- The
|
Thanks for the detailed review. I addressed the actionable items and nits as follows: 1. snaptrade_items_controller complexity (Major)
2. Interpolation key consistency (%{product} vs %{product_name}) (Minor)
3. Trialing pluralization in English locale (Minor)
4. polish_pluralization_test private API nit
5. pl locale audit wrapper nit
6. SnapTrade locale key alignment
Validation
Thanks again for the review. |
jjmata
left a comment
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
These should not be checked in.
There was a problem hiding this comment.
These should not be checked in.
There was a problem hiding this comment.
These should not be checked in, right?
|
@jjmata Removed the files as per the ongoing discussion. I will take a look at it and provide my comments :) |
…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
…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
Summary
This PR finalizes Polish localization support and makes the localization QA process reusable for other locales.
What changed
rails-i18ndependency and enabled Polish in supported locales.Validation
pl:test/lib/polish_pluralization_test.rbtest/lib/money_test.rbtest/i18n_test.rbOut of scope
Summary by CodeRabbit
Release Notes
New Features
Tooling & Quality