-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
[BUG] Using InterpolationCompiler fails #626
Comments
I am able to reproduce this bug (6 months late, it seems). I owe you a writeup. Gemfilesource 'https://rubygems.org'
gem 'i18n', '1.10.0' script.rbrequire 'bundler'
Bundler.setup
require 'i18n'
I18n::Backend::Simple.include(I18n::Backend::InterpolationCompiler)
I18n.load_path << Dir[File.expand_path("locales") + "/*.yml"]
I18n.default_locale = :en
|
I totally forgot about this and I feel bad that you felt obligated to that massive writeup. Totally agree to remove or extract that module. |
What I tried to do
Using the
InterpolationCompiler
as described in https://github.com/ruby-i18n/i18n/blob/master/lib/i18n/backend/interpolation_compiler.rb#L13 stopped working with i18n v1.9.1What I expected to happen
Should not lead to raising an exception
What actually happened
Raises
TypeError
"can't define singleton" as soon as aI18n.default_locale=
is called.Versions of i18n, rails, and anything else you think is necessary
$ ruby -v -r i18n -e'I18n::Backend::Simple.include(I18n::Backend::InterpolationCompiler); I18n.load_path << Dir[File.expand_path("locales") + "/*.yml"]; I18n.default_locale = :en'
Thanks! ❤️
The text was updated successfully, but these errors were encountered: