houdini/app/javascript/i18n.js.erb

7 lines
340 B
Text
Raw Normal View History

2019-11-18 23:32:57 +00:00
const I18n = require('i18n-js');
2019-11-15 22:28:55 +00:00
2019-11-18 23:32:57 +00:00
I18n.translations = I18n.translations || {};
<% I18n::JS::translations.select{|k,v| Houdini.intl.available_locales.map{|i| i.to_s}.include?(k.to_s)}.each do |k,v| %>
2019-11-18 23:32:57 +00:00
I18n.translations['<%= k %>'] = I18n.extend((I18n.translations['<%= k %>'] || {}),<%= JSON.generate(v) %>);
<% end %>
module.exports = I18n;