سؤال

Im trying to localize the labels for ActiveScaffold STI children. In development it works fine with just this:

es:
  activerecord:
    models:
      rule: "Regla"
      concrete_rule: "Regla puntual"
      weekly_rule: "Regla semanal"
      monthly_rule: "Regla mensual"

But in production it always takes the default locale set in application. I know this is an Activescaffold problem and I have solved it for another labels setting the translations inside the key active_scaffold but it's not working for STI. Any help with this ?

EDIT:

I found where activescaffold gets the i18n translation but I still don't know how to make it to take the correct translation in a production environment.

new_sti_link.label = child.to_s.camelize.constantize.model_name.human
هل كانت مفيدة؟

المحلول

Finally I found the only way to achieve what I want is to monkey patch ActiveScaffold to accept lambdas as parameters for the labels and to evaluate them when rendering the view.

نصائح أخرى

You can try to clean cache in your browser. Or change in your production.rb this line from "true" to "false"

config.i18n.fallbacks = false
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top