mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
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
This commit is contained in:
@@ -161,7 +161,7 @@ class MoneyTest < ActiveSupport::TestCase
|
||||
|
||||
test "all supported locales can format money without errors" do
|
||||
# Ensure all supported locales from LanguagesHelper::SUPPORTED_LOCALES work
|
||||
supported_locales = %w[en fr de es tr nb ca ro pt-BR zh-CN zh-TW nl]
|
||||
supported_locales = LanguagesHelper::SUPPORTED_LOCALES
|
||||
|
||||
supported_locales.each do |locale|
|
||||
locale_sym = locale.to_sym
|
||||
|
||||
27
test/lib/polish_pluralization_test.rb
Normal file
27
test/lib/polish_pluralization_test.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
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
|
||||
Reference in New Issue
Block a user