Include datepicker i18n only as needed

* Restore the javascript_tag_for_i18n_datepicker helper (and actually use it)
* Include the datepicker i18n JS in the asset precompilation list
This commit is contained in:
Dan Rice 2016-02-16 22:08:15 -05:00
parent 91849c5316
commit 4b046b98ea
5 changed files with 10 additions and 9 deletions

View file

@ -169,6 +169,14 @@ module ApplicationHelper
return js.html_safe
end
def javascript_tag_for_i18n_datepicker
locale = I18n.locale
# do not include en as locale since this the available by default
if locale && locale != :en
javascript_include_tag("jquery-ui/datepicker-#{locale}")
end
end
def done_path(controller_name, type)
case controller_name
when "contexts"