Module: Decidim::TermCustomizer::I18nBackend::Implementation
- Includes:
- I18n::Backend::Base
- Included in:
- Decidim::TermCustomizer::I18nBackend
- Defined in:
- lib/decidim/term_customizer/i18n_backend.rb
Instance Method Summary collapse
-
#available_locales ⇒ Object
Get available locales from the translations hash.
- #initialized? ⇒ Boolean
-
#reload! ⇒ Object
Clean up translations hash on reload!.
- #translations ⇒ Object
Instance Method Details
#available_locales ⇒ Object
Get available locales from the translations hash
17 18 19 20 21 |
# File 'lib/decidim/term_customizer/i18n_backend.rb', line 17 def available_locales Translation.available_locales rescue ::ActiveRecord::StatementInvalid [] end |
#initialized? ⇒ Boolean
23 24 25 |
# File 'lib/decidim/term_customizer/i18n_backend.rb', line 23 def initialized? !@translations.nil? end |
#reload! ⇒ Object
Clean up translations hash on reload!
28 29 30 31 |
# File 'lib/decidim/term_customizer/i18n_backend.rb', line 28 def reload! @translations = nil super end |
#translations ⇒ Object
33 34 35 36 37 38 |
# File 'lib/decidim/term_customizer/i18n_backend.rb', line 33 def translations return @translations if @translations return {} unless TermCustomizer.loader @translations = TermCustomizer.loader.translations_hash end |