feat: add Hungarian (hu) localization (#1677)

* Add Hungarian (hu) localization

Add complete Hungarian translation files and register hu locale

* Update hu.yml

* Hungarian locale: currency formatting & fixes
This commit is contained in:
Brendon Scheiber
2026-05-06 22:38:51 +02:00
committed by GitHub
parent 9e369831ce
commit dce2213a98
97 changed files with 4885 additions and 8 deletions

View File

@@ -159,6 +159,15 @@ class MoneyTest < ActiveSupport::TestCase
assert_equal "TW$1,000.12", Money.new(1000.12, :twd).format(locale: :"zh-TW")
end
test "formats correctly for Hungarian locale" do
# Hungarian uses space as thousands delimiter, comma as decimal separator, symbol after number
# HUF has 0 decimal places (no fillér)
assert_equal "1 000 Ft", Money.new(1000, :huf).format(locale: :hu)
# Non-HUF currencies keep their own precision
assert_equal "1 000,12 $", Money.new(1000.12, :usd).format(locale: :hu)
assert_equal "1 000,12 €", Money.new(1000.12, :eur).format(locale: :hu)
end
test "all supported locales can format money without errors" do
# Ensure all supported locales from LanguagesHelper::SUPPORTED_LOCALES work
supported_locales = LanguagesHelper::SUPPORTED_LOCALES