onyugg
Last Updated: February 25, 2016
·
573
· errm
3ab480f83c76db55c2fbbf1168da2e16

Use default translations

So I have seen this done a few times:

begin
  I18n.t "something.to.translate"
rescue I18n::MissingTranslationData
  "algo para traducir"
end

but it is a lot more elegant & efficient to use a default value rather than throwing exceptions about

I18n.t "something.to.translate", :default =>  "algo para traducir"
Say Thanks
Respond