ruby-i18n / i18n

Internationalization (i18n) library for Ruby
MIT License
976 stars 408 forks source link

[BUG] Locale contains separator does not work in v1.13.0 #657

Closed tubaxenor closed 1 year ago

tubaxenor commented 1 year ago

What I tried to do

Translate a string in a locale with separator

What I expected to happen

Correctly translated as defined in backend store

What actually happened

Returns translation missing

Versions of i18n, rails, and anything else you think is necessary

# v1.12.0
require "i18n"

I18n.enforce_available_locales = false
I18n.backend.store_translations(:"en-api", v1: {foo: 'Foo in API'})
I18n.locale = :"en-api.v1"
I18n.t("foo")
# => "Foo in API"

# v1.13.0
require "i18n"

I18n.enforce_available_locales = false
I18n.backend.store_translations(:"en-api", v1: {foo: 'Foo in API'})
I18n.locale = :"en-api.v1"
I18n.t("foo")
# => "translation missing: en-api.v1.foo"

PR: https://github.com/ruby-i18n/i18n/pull/656

Would also like to know if using separator as key is deprecated, if so, maybe we can start warn and drop the usage in future releases 🙇

radar commented 1 year ago

Is this still an issue on the latest v1.14 release?