diff --git a/app/javascript/i18n.js.erb b/app/javascript/i18n.js.erb index 4c45aa88..3c079cd3 100644 --- a/app/javascript/i18n.js.erb +++ b/app/javascript/i18n.js.erb @@ -1,7 +1,8 @@ -import I18n from 'i18n-js'; +const I18n = require('i18n-js'); -I18n.translations || (I18n.translations = {}); +I18n.translations = I18n.translations || {}; <% I18n::JS::translations.each do |k,v| %> <% byebug %> -I18n.translations[<%= k %>] = I18n.extend((I18n.translations[<%= k %>] || {}),<%= JSON.generate(v) %>); -<% end %> \ No newline at end of file +I18n.translations['<%= k %>'] = I18n.extend((I18n.translations['<%= k %>'] || {}),<%= JSON.generate(v) %>); +<% end %> +module.exports = I18n; \ No newline at end of file diff --git a/app/views/layouts/apified.html.erb b/app/views/layouts/apified.html.erb index f5ffbf51..6dc8f0dd 100644 --- a/app/views/layouts/apified.html.erb +++ b/app/views/layouts/apified.html.erb @@ -6,8 +6,8 @@ <%= "#{yield(:title)} - #{Settings.general.name}" %> - <%= IncludeAsset.js '/client/js/i18n.js' %>