mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
fix #1115. The datapicker is now passed the current locale to localize the datepicker
This commit is contained in:
parent
a3837cc4e3
commit
da93b82b2b
5 changed files with 62 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue