Files
sure/test/lib/polish_pluralization_test.rb
UberDudePL cebdf1d4f7 Polish localization: complete translations, pluralization fixes, and 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
2026-04-07 11:55:58 +02:00

28 lines
877 B
Ruby

require "test_helper"
require "securerandom"
class PolishPluralizationTest < ActiveSupport::TestCase
test "uses rails i18n plural rules for polish" do
translation_key = "test_pluralization_#{SecureRandom.hex(6)}"
I18n.backend.store_translations(:pl, translation_key => {
sample: {
one: "one",
few: "few",
many: "many",
other: "other"
}
})
path = "#{translation_key}.sample"
assert_equal "many", I18n.t(path, locale: :pl, count: 0)
assert_equal "one", I18n.t(path, locale: :pl, count: 1)
assert_equal "few", I18n.t(path, locale: :pl, count: 2)
assert_equal "many", I18n.t(path, locale: :pl, count: 5)
assert_equal "many", I18n.t(path, locale: :pl, count: 12)
assert_equal "few", I18n.t(path, locale: :pl, count: 22)
assert_equal "many", I18n.t(path, locale: :pl, count: 25)
end
end