Class: FastGettext::TranslationRepository::Logger
- Defined in:
- lib/fast_gettext/translation_repository/logger.rb
Overview
This should be used in a TranslationRepository::Chain, so tat untranslated keys can be found Responsibility:
- log every translation call
Instance Attribute Summary collapse
-
#callback ⇒ Object
Returns the value of attribute callback.
Attributes inherited from Base
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(name, options = {}) ⇒ Logger
constructor
A new instance of Logger.
- #plural(*keys) ⇒ Object
Methods inherited from Base
#available_locales, #pluralisation_rule, #reload
Constructor Details
#initialize(name, options = {}) ⇒ Logger
Returns a new instance of Logger.
13 14 15 16 |
# File 'lib/fast_gettext/translation_repository/logger.rb', line 13 def initialize(name, = {}) super self.callback = [:callback] end |
Instance Attribute Details
#callback ⇒ Object
Returns the value of attribute callback.
11 12 13 |
# File 'lib/fast_gettext/translation_repository/logger.rb', line 11 def callback @callback end |
Instance Method Details
#[](key) ⇒ Object
18 19 20 21 |
# File 'lib/fast_gettext/translation_repository/logger.rb', line 18 def [](key) callback.call(key) nil end |
#plural(*keys) ⇒ Object
23 24 25 26 |
# File 'lib/fast_gettext/translation_repository/logger.rb', line 23 def plural(*keys) callback.call(keys) [] end |