weppos / breadcrumbs_on_rails

A simple Ruby on Rails plugin for creating and managing a breadcrumb navigation.
https://simonecarletti.com/code/breadcrumbs-on-rails
MIT License
944 stars 188 forks source link

Problem with translation #61

Closed jeffersonegenial closed 8 years ago

jeffersonegenial commented 10 years ago

I'm using three languages ​​in my application, when changing language sometimes he translates, sometimes not.

How to solve?

Since I am using:    add_breadcrumb I18n.t ("activerecord.models.account"): accounts_path    add_breadcrumb I18n.t (: listing): accounts_path,: only => [: index]    add_breadcrumb I18n.t (: new): new_account_path,: only => [: new,: create]    add_breadcrumb I18n.t (: editLbl): edit_account_path,: only => [: edit,: update]

sasselin commented 9 years ago

+1 Same thing!

marcelofraga commented 9 years ago

+1

xandrck commented 9 years ago

I have same problem. After refreshing page breadcrumb randomly uses locales.

I solved it this way:

before_filter :parent_breadcrumb

private
def parent_breadcrumb
  add_breadcrumb I18n.t ("activerecord.models.account"): accounts_path 
end
weppos commented 8 years ago

Closing as won't fix. The solution suggested by @xandrck is the best one, as it doesn't depend on the order used to load the various dependencies (including localizations).