mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-17 20:58:09 +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
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
'jquery.truncator','jquery.jeditable.mini', 'jquery.cookie', 'jquery.blockUI',
|
||||
'jquery.form','jquery.ui.autocomplete.selectFirst',
|
||||
:cache => 'jquery-cached' %>
|
||||
<%= javascript_tag_for_i18n_datepicker %>
|
||||
<%= javascript_include_tag 'hoverIntent','superfish','application',
|
||||
'accesskey-hints','niftycube','swfobject',
|
||||
:cache => 'tracks-cached' %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue