Class: Translator

Inherits:
Object
  • Object
show all
Defined in:
lib/translator.rb

Direct Known Subclasses

DefaultTranslator, RealTranslator

Constant Summary collapse

LANG_BREAK =
/^--- (\S+) ----*\s*$/

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.defaultObject



5
6
7
# File 'lib/translator.rb', line 5

def self.default
  DefaultTranslator.instance
end

.for(locale_code) ⇒ Object



9
10
11
12
# File 'lib/translator.rb', line 9

def self.for(locale_code)
  return RealTranslator.new(locale_code) unless locale_code.nil?
  return default
end

Instance Method Details

#localize(text) ⇒ Object



14
# File 'lib/translator.rb', line 14

def localize(text); text; end