Class: FastGettext::TranslationRepository::Mo
- Defined in:
- lib/fast_gettext/translation_repository/mo.rb
Overview
Responsibility:
- find and store mo files
- provide access to translations in mo files
Direct Known Subclasses
Constant Summary collapse
- CONTEXT_SEPARATOR =
"\u0004"
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #all_translations ⇒ Object
- #available_locales ⇒ Object
-
#initialize(name, options = {}) ⇒ Mo
constructor
A new instance of Mo.
- #pluralisation_rule ⇒ Object
- #reload ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(name, options = {}) ⇒ Mo
Returns a new instance of Mo.
12 13 14 15 16 |
# File 'lib/fast_gettext/translation_repository/mo.rb', line 12 def initialize(name, = {}) super @eager_load = .fetch(:eager_load, false) reload end |
Instance Method Details
#all_translations ⇒ Object
31 32 33 |
# File 'lib/fast_gettext/translation_repository/mo.rb', line 31 def all_translations current_translations.data end |
#available_locales ⇒ Object
18 19 20 |
# File 'lib/fast_gettext/translation_repository/mo.rb', line 18 def available_locales @files.keys end |
#pluralisation_rule ⇒ Object
22 23 24 |
# File 'lib/fast_gettext/translation_repository/mo.rb', line 22 def pluralisation_rule current_translations.pluralisation_rule end |
#reload ⇒ Object
26 27 28 29 |
# File 'lib/fast_gettext/translation_repository/mo.rb', line 26 def reload find_and_store_files(@name, @options) super end |