-
-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined method 'initialized?' for I18n::Backend::ActiveRecord #428
Comments
It's due to |
+1 |
try add this code to initializers: module I18n
module JS
def self.translations
::I18n::Backend::Simple.new.instance_eval do
init_translations unless initialized?
Private::HashWithSymbolKeys.new(translations)
.slice(*::I18n.available_locales)
.to_h
end
end
end
end Keep in mind that in this case i18n-js will get translations from yaml instead database |
@andreslemik +1 |
A new version |
Update: If you do try this out, mind the reloading-limitations documented in #521. Possible workarounds for use-cases with and without a |
i18n-active_record 0.4.0 includes a patch that makes it compatible as a backend for i18n-js. I'm using an (ActiveRecord, Simple) chain backend and it works fine. More details are in the PR svenfuchs/i18n-active_record#97. |
Am running Rails 4.2.5.1. Have tried versions 3.0.0.rc11 as well as 2.1.2 of the i18n-js gem. With both of them, when I run 'rake i18n:js:export' I get NoMethodError: undefined method `initialized?' for #I18n::Backend::ActiveRecord.
I know other people have seen this error for other i18n backends (and appear to have found solutions) - is there a known workaround for this with the ActiveRecord backend?
The text was updated successfully, but these errors were encountered: