You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# config/initializers/fast_gettext.rbFastGettext.default_available_locales=%w[deen]# or %i for that matterFastGettext.default_text_domain='app'
and the following Mobility initializer:
# config/initializers/mobility.rbMobility.configuredopluginsdobackend:columnactive_recordreaderwriterbackend_readerquerycachepresencelocale_accessors# This line creates the problem
I'm getting the error :de is not a valid locale. I18n.available_locales returns: ["de", "en"]
Appearently, FastGettext sets the array to strings, whereas Mobility is looking for symbols.
Changing the FastGettext initializer to the following is a workaround:
# config/initializers/fast_gettext.rb
FastGettext.default_available_locales = %w[de en]
FastGettext.default_text_domain = 'app'
I18n.available_locales = %i[de en] # This line is needed
Note that changing FastGettext.default_available_locales to an array of symbols does not help.
Since Mobility is the first Gem that appears to have trouble with the locales being stored as Strings, I would like to propose, if adequate, to add String locales support to Mobility. Ideally, the gem would support both symbol and string keys for I18n.available_locales.
Best,
Kalsan
The text was updated successfully, but these errors were encountered:
I would like to propose, if adequate, to add String locales support to Mobility. Ideally, the gem would support both symbol and string keys for I18n.available_locales.
That sounds reasonable, could you make a PR to do that?
kalsan
added a commit
to kalsan/mobility
that referenced
this issue
Apr 6, 2023
Having the following FastGettext initializer:
and the following Mobility initializer:
I'm getting the error
:de is not a valid locale
.I18n.available_locales
returns:["de", "en"]
Appearently, FastGettext sets the array to strings, whereas Mobility is looking for symbols.
Changing the FastGettext initializer to the following is a workaround:
Note that changing
FastGettext.default_available_locales
to an array of symbols does not help.Since Mobility is the first Gem that appears to have trouble with the locales being stored as Strings, I would like to propose, if adequate, to add String locales support to Mobility. Ideally, the gem would support both symbol and string keys for
I18n.available_locales
.Best,
Kalsan
The text was updated successfully, but these errors were encountered: