edgarjs / ajaxful-rating

Provides a simple way to add rating functionality to your application.
http://rdoc.info/projects/edgarjs/ajaxful-rating
417 stars 127 forks source link

The {{key}} interpolation syntax in I18n messages is deprecated. Please use %{key} instead #43

Closed TeuF closed 14 years ago

TeuF commented 14 years ago

Hi,

With rails3 I get this message

The {{key}} interpolation syntax in I18n messages is deprecated. Please use %{key} instead.
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:162:in `interpolate'
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:157:in `gsub'
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:157:in `interpolate'
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:197:in `preserve_encoding'
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:156:in `interpolate'
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:49:in `translate'
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n.rb:152:in `t'
/Library/Ruby/Gems/1.8/bundler/gems/ajaxful-rating-85221d1/lib/axr/locale.rb:26:in `i18n'
/Library/Ruby/Gems/1.8/bundler/gems/ajaxful-rating-85221d1/lib/axr/stars_builder.rb:65:in `ratings_tag'
/Library/Ruby/Gems/1.8/bundler/gems/ajaxful-rating-85221d1/lib/axr/stars_builder.rb:111:in `wrapper_tag'
/Library/Ruby/Gems/1.8/bundler/gems/ajaxful-rating-85221d1/lib/axr/stars_builder.rb:23:in `render'
/Library/Ruby/Gems/1.8/bundler/gems/ajaxful-rating-85221d1/lib/axr/helpers.rb:83:in `ratings_for'

To avoid it I had to change lib/axr/locale.rb like this:

    DEFAULTS = {
      :user_rating => "Your rating: %{value} out of %{max}",
      :global_average => "Global rating average: %{value} out of %{max}",
      :hover => "Rate %{value} out of %{max}"
    }

May be you could commit a fix with this ?

Thx.

odorcicd commented 14 years ago

Fixed with this commit: http://github.com/edgarjs/ajaxful-rating/commit/81b563ef4e4f7937b769ea64b589d990dc833b43