Last Updated: February 25, 2016
·
712
· errm

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"