fix #1115. The datapicker is now passed the current locale to localize the datepicker

This commit is contained in:
Reinier Balt 2011-02-25 17:10:33 +01:00
parent a3837cc4e3
commit da93b82b2b
5 changed files with 62 additions and 1 deletions

View file

@ -240,7 +240,7 @@ module ApplicationHelper
end
def generate_i18n_strings
js = ""
js = "i18n_locale='#{I18n.locale}';\n"
js << "i18n = new Array();\n"
%w{
shared.toggle_multi shared.toggle_multi_title
@ -259,4 +259,10 @@ module ApplicationHelper
return js
end
def javascript_tag_for_i18n_datepicker
# do not include en as locale since this the available by default
locales_without_en = I18n::available_locales.find_all{|locale| !(locale.to_s == 'en') }
return javascript_include_tag(locales_without_en.map{|locale| "i18n/jquery.ui.datepicker-#{locale}.js"})
end
end