Module: RouteTranslator::RouteSet
- Includes:
- DictionaryManagement, Helpers, Translator
- Defined in:
- lib/route_translator/route_set.rb,
lib/route_translator/route_set/helpers.rb,
lib/route_translator/route_set/translator.rb,
lib/route_translator/route_set/dictionary_management.rb
Defined Under Namespace
Modules: DictionaryManagement, Helpers, Translator
Instance Attribute Summary collapse
-
#dictionary ⇒ Object
Returns the value of attribute dictionary.
-
#localized_routes ⇒ Object
Returns the value of attribute localized_routes.
Instance Method Summary collapse
-
#translate_from_file(file_path = nil) ⇒ Object
Use the translations from the specified file.
-
#translate_with_dictionary(&block) ⇒ Object
Use yield the block passing and empty dictionary as a paramenter.
-
#translate_with_i18n(*wanted_locales) ⇒ Object
Use the i18n setting from the app.
Methods included from Helpers
#available_locales, #available_locales=, #default_locale, #default_locale=, #default_locale?, #locale_suffix
Methods included from Translator
#add_untranslated_helpers_to_controllers_and_views, #request_method_array, #translate, #translate_path, #translate_path_segment, #translate_route, #translate_string, #translations_for, #untranslated_route
Methods included from DictionaryManagement
#add_dictionary_from_file, #init_i18n_dictionary, #load_dictionary_from_file, #merge_translations, #yield_dictionary
Instance Attribute Details
#dictionary ⇒ Object
Returns the value of attribute dictionary.
11 12 13 |
# File 'lib/route_translator/route_set.rb', line 11 def dictionary @dictionary end |
#localized_routes ⇒ Object
Returns the value of attribute localized_routes.
11 12 13 |
# File 'lib/route_translator/route_set.rb', line 11 def localized_routes @localized_routes end |
Instance Method Details
#translate_from_file(file_path = nil) ⇒ Object
Use the translations from the specified file
26 27 28 29 30 31 32 33 34 |
# File 'lib/route_translator/route_set.rb', line 26 def translate_from_file(file_path = nil) file_path = absolute_path(file_path) reset_dictionary Dir[file_path].each do |file| add_dictionary_from_file(file) end translate end |
#translate_with_dictionary(&block) ⇒ Object
Use yield the block passing and empty dictionary as a paramenter
20 21 22 23 |
# File 'lib/route_translator/route_set.rb', line 20 def translate_with_dictionary(&block) yield_dictionary &block translate end |
#translate_with_i18n(*wanted_locales) ⇒ Object
Use the i18n setting from the app
14 15 16 17 |
# File 'lib/route_translator/route_set.rb', line 14 def translate_with_i18n(*wanted_locales) init_i18n_dictionary(*wanted_locales) translate end |