Class: ActionView::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/gettext/rails.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#render_file(template_path, use_full_path = true, local_assigns = {}) ⇒ Object

This provides to find localized template files such as foo_ja.rhtml, foo_ja_JP.rhtml instead of foo.rhtml. If the file isn’t found, foo.rhtml is used.



276
277
278
279
280
281
282
283
# File 'lib/gettext/rails.rb', line 276

def render_file(template_path, use_full_path = true, local_assigns = {})
  locale = GetText.locale
  [locale.to_general, locale.to_s, locale.language, Locale.default.language].uniq.each do |v|
	localized_path = "#{template_path}_#{v}"
	return render_file_without_locale(localized_path, use_full_path, local_assigns) if file_exists? localized_path
  end
  render_file_without_locale(template_path, use_full_path, local_assigns)
end

#render_file_without_localeObject

:nodoc:



273
# File 'lib/gettext/rails.rb', line 273

alias render_file_without_locale render_file