Class: FastGettext::TranslationRepository::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/fast_gettext/translation_repository/base.rb

Overview

Responsibility:

- base for all repositories
- fallback as empty repository, that cannot translate anything but does not crash

Direct Known Subclasses

Chain, Logger, Mo, Yaml

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Base

Returns a new instance of Base.



7
8
9
10
# File 'lib/fast_gettext/translation_repository/base.rb', line 7

def initialize(name,options={})
  @name = name
  @options = options
end

Instance Method Details

#[](key) ⇒ Object



20
21
22
# File 'lib/fast_gettext/translation_repository/base.rb', line 20

def [](key)
  current_translations[key]
end

#available_localesObject



16
17
18
# File 'lib/fast_gettext/translation_repository/base.rb', line 16

def available_locales
  []
end

#plural(*keys) ⇒ Object



24
25
26
# File 'lib/fast_gettext/translation_repository/base.rb', line 24

def plural(*keys)
  current_translations.plural(*keys)
end

#pluralisation_ruleObject



12
13
14
# File 'lib/fast_gettext/translation_repository/base.rb', line 12

def pluralisation_rule
  nil
end