Module: ActionDispatch::Routing::Translator
- Defined in:
- lib/rails-translate-routes.rb
Class Method Summary collapse
- .i18n(*locales) ⇒ Object
- .translate(&block) ⇒ Object
- .translate_from_file(file_path, options = {}) ⇒ Object
Class Method Details
.i18n(*locales) ⇒ Object
400 401 402 |
# File 'lib/rails-translate-routes.rb', line 400 def i18n *locales RailsTranslateRoutes.init_with_i18n(*locales).translate Rails.application.routes end |
.translate(&block) ⇒ Object
387 388 389 |
# File 'lib/rails-translate-routes.rb', line 387 def translate &block RailsTranslateRoutes.init_with_yield(&block).translate Rails.application.routes end |
.translate_from_file(file_path, options = {}) ⇒ Object
391 392 393 394 395 396 397 398 |
# File 'lib/rails-translate-routes.rb', line 391 def translate_from_file(file_path, = {}) file_path = %w(config locales routes.yml) if file_path.blank? r = RailsTranslateRoutes.init_from_file(file_path) r.prefix_on_default_locale = true if && [:prefix_on_default_locale] == true r.no_prefixes = true if && [:no_prefixes] == true r.keep_untranslated_routes = true if && [:keep_untranslated_routes] == true r.translate Rails.application.routes end |