mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
locale data as js asset
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
# Defines a global I18n object containing the language of the current locale
|
||||
<%- I18n.backend.send(:init_translations) unless I18n.backend.initialized? %>
|
||||
window.I18n = <%= I18n.backend.send(:translations)[I18n.locale].with_indifferent_access.to_json.html_safe %>
|
||||
|
||||
# Declares the translation function t.
|
||||
# You can use t('login') in Javascript.
|
||||
window.t = (key, options = {}) ->
|
||||
@@ -1,5 +0,0 @@
|
||||
- # TODO: load json from separate file that can be cached
|
||||
%script
|
||||
window.I18n =
|
||||
= I18n.backend.send(:translations)[I18n.locale].with_indifferent_access.to_json.html_safe
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
%link{href: "https://fonts.googleapis.com/css?family=Roboto:400,300italic,400italic,300,700,700italic|Oswald:300,400,700", rel: "stylesheet", type: "text/css"}
|
||||
|
||||
= yield :scripts
|
||||
= render "layouts/i18n_translations"
|
||||
%script{src: "//maps.googleapis.com/maps/api/js?libraries=places,geometry&sensor=false"}
|
||||
= split_stylesheet_link_tag "darkswarm/all"
|
||||
= javascript_include_tag "darkswarm/all"
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
%link{href: "https://fonts.googleapis.com/css?family=Roboto:400,300italic,400italic,300,700,700italic|Oswald:300,400,700", rel: "stylesheet", type: "text/css"}
|
||||
|
||||
= yield :scripts
|
||||
= render "layouts/i18n_translations"
|
||||
%script{src: "//maps.googleapis.com/maps/api/js?libraries=places&sensor=false"}
|
||||
= stylesheet_link_tag "darkswarm/all"
|
||||
= javascript_include_tag "darkswarm/all"
|
||||
|
||||
Reference in New Issue
Block a user