Class: I18nJS::EmbedFallbackTranslationsPlugin
- Defined in:
- lib/i18n-js/embed_fallback_translations_plugin.rb
Instance Attribute Summary
Attributes inherited from Plugin
#config, #main_config, #schema
Instance Method Summary collapse
Methods inherited from Plugin
#after_export, #enabled?, #initialize, key, #setup
Constructor Details
This class inherits a constructor from I18nJS::Plugin
Instance Method Details
#transform(translations:) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/i18n-js/embed_fallback_translations_plugin.rb', line 14 def transform(translations:) return translations unless enabled? if use_fallback? transform_with_i18n_fallbacks(translations) else transform_with_default_locale(translations) end end |
#validate_schema ⇒ Object
7 8 9 10 11 12 |
# File 'lib/i18n-js/embed_fallback_translations_plugin.rb', line 7 def validate_schema valid_keys = %i[enabled] schema.expect_required_keys(keys: valid_keys) schema.reject_extraneous_keys(keys: valid_keys) end |