Phobos98
Phobos98

Reputation: 456

I18n strange behaviour

I am using I18n with Redis store, and have a strange behavior after updating to Rails 3.2.13

[6] pry(main)> I18n.t("my_website_field")
=> "M"
[7] pry(main)> $redis.get("en.my_website_field")
=> "\"My website\""

I am getting only the first letters of the translations

Upvotes: 4

Views: 114

Answers (1)

Dan Bradbury
Dan Bradbury

Reputation: 2116

To my knowledge I believe that redis-store has issues with certain versions of Rails (3.2.13 happens to be one of those).

Since I was really curious about why this would be happening I opened up the Github change log and took a look at the logic they changed in the 3.2.12 -> 3.2.13 update.

The main change that I noticed was the dependency chain in ActiveSupport for i18n. The code was changed FROM

s.add_dependency('i18n', '~> 0.6')

TO

s.add_dependency('i18n', '= 0.6.1') 

The only other changes were (from the changelog):

Add i18n scope to `distance_of_time_in_words

So if I had to take an educated guess I would say that the forcing of the use of i18n to 0.6.1 created some type of conflict with redis-store.

Note: I will continue to look into the issue with the change logs to i18n and post if I have any more information on the subject. Can't find the specific issue in commit history and they don't keep a changelog (havent for 3 years :/) but I'd be curious to see if forcing the old version control would allow i18n to function properly.

Upvotes: 1

Related Questions