开发者

Rails 2.3.5 and I18n localization problem

For a project I am locked into rails version 2.3.5;

I am trying to localize the application and and I want to use a specific locale.

Let's say, for simplicity, I want to switch to en-US https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en-US.yml

My problem is that when I set the default locale in environment.rb to be 'en-US', in my views, wherever I have distance_time_in_words, I get %{count} in months or %{count} in hours.

I tried other locales and the problem persists with %{count} showing up.

Now, if I don't include a def开发者_如何学JAVAault locale by commenting out config.i18n.default_locale = :en-US in enviroment.rb, distance_time_in_words returns correctly the information; that is %{count} is replaced by a number.

I don't want to use the i18n plugin since the I18n module is included with activesupport 2.3.5 (\activesupport-2.3.5\lib\active_support\vendor\i18n-0.1.3)

Thank you in advance!!

Thank you in advance.


Rails 2.3.5 used an older version of the i18n gem you want to use {{count}} for your interpolation instead of %{count}


I believe underscore is the way to combine country and region codes this way.

try en_US instead of en-US

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜