Module: Localite::SymbolAdapter

Defined in:
lib/localite.rb

Overview

Translating a string:

If no translation is found we try to translate the string in the base language. If there is no base language translation we raise areturn the string, assuming a base language string.

Instance Method Summary collapse

Instance Method Details

#t(*args) ⇒ Object



67
68
69
70
# File 'lib/localite.rb', line 67

def t(*args)
  translated = Localite.translate(self, :do_raise)
  Localite::Template.run translated, *args
end

#t?(*args) ⇒ Boolean

returns nil, if there is no translation.

Returns:

  • (Boolean)


73
74
75
76
# File 'lib/localite.rb', line 73

def t?(*args)
  translated = Localite.translate(self, :no_raise)
  Localite::Template.run translated, *args if translated
end