Class: ActionView::Base
Public Instance Methods
_pick_template_with_locale (template_path)
# File lib/locale_rails/action_view.rb, line 37 37: def _pick_template_with_locale(template_path) #: shouldn't memoize. 38: _pick_template_with_locale_main(template_path, I18n.candidates) 39: end
_pick_template_with_locale_main (template_path, tags)
# File lib/locale_rails/action_view.rb, line 18 18: def _pick_template_with_locale_main(template_path, tags) 19: path = template_path.sub(/^\//, '') 20: if m = path.match(/(.*)\.(\w+)$/) 21: template_file_name, template_file_extension = m[1], m[2] 22: else 23: template_file_name = path 24: end 25: 26: tags.each do |v| 27: file_name = "#{template_file_name}_#{v}" 28: begin 29: return _pick_template_without_locale(file_name) 30: rescue MissingTemplate => e 31: end 32: end 33: _pick_template_without_locale(template_path) 34: end