From f396d307477d68c6235ec9209bd28d3057891d24 Mon Sep 17 00:00:00 2001 From: Julius Pabrinkis Date: Thu, 8 Jun 2017 22:32:43 +0100 Subject: [PATCH] Render i18n-js config inside darkswarm and admin layouts --- .../spree/layouts/admin/add_i18n_script.html.haml.deface | 3 +++ app/views/layouts/_i18n_script.html.haml | 4 ++++ app/views/layouts/darkswarm.html.haml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 app/overrides/spree/layouts/admin/add_i18n_script.html.haml.deface create mode 100644 app/views/layouts/_i18n_script.html.haml diff --git a/app/overrides/spree/layouts/admin/add_i18n_script.html.haml.deface b/app/overrides/spree/layouts/admin/add_i18n_script.html.haml.deface new file mode 100644 index 0000000000..fd377fa5ec --- /dev/null +++ b/app/overrides/spree/layouts/admin/add_i18n_script.html.haml.deface @@ -0,0 +1,3 @@ +/ insert_before "div#wrapper" + += render "layouts/i18n_script" diff --git a/app/views/layouts/_i18n_script.html.haml b/app/views/layouts/_i18n_script.html.haml new file mode 100644 index 0000000000..f6cc1dc837 --- /dev/null +++ b/app/views/layouts/_i18n_script.html.haml @@ -0,0 +1,4 @@ +%script + I18n.default_locale = "#{I18n.default_locale}"; + I18n.locale = "#{I18n.locale}"; + I18n.fallbacks = "default_locale"; diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index b281d34c82..298083425c 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -17,7 +17,7 @@ = split_stylesheet_link_tag "darkswarm/all" = javascript_include_tag "darkswarm/all" - + = render "layouts/i18n_script" = render "layouts/bugherd_script" = csrf_meta_tags