Made the insertion of the English Translation File conditional + removed window.translations from the global object to save some memory
This commit is contained in:
parent
6c5837ae49
commit
0f6d20e394
|
@ -4,6 +4,7 @@ import sprintf from './sprintf';
|
|||
const langAttribute = document.querySelector('html').getAttribute('lang');
|
||||
const lang = (langAttribute || 'en').replace(/-/g, '_');
|
||||
const locale = new Jed(window.translations || {});
|
||||
delete window.translations;
|
||||
|
||||
/**
|
||||
Translates `text`
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
- if content_for?(:library_javascripts)
|
||||
= yield :library_javascripts
|
||||
|
||||
= javascript_include_tag asset_path("locale/#{I18n.locale.to_s || I18n.default_locale.to_s}/app.js")
|
||||
= javascript_include_tag asset_path("locale/#{I18n.locale.to_s || I18n.default_locale.to_s}/app.js") unless I18n.locale == :en
|
||||
= webpack_bundle_tag "webpack_runtime"
|
||||
= webpack_bundle_tag "common"
|
||||
= webpack_bundle_tag "main"
|
||||
|
|
Loading…
Reference in New Issue