Make sure to only create javascript locales if Houdini has a translation for it
This commit is contained in:
parent
ba7af72598
commit
6e9d2f2d4d
1 changed files with 1 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
const I18n = require('i18n-js');
|
||||
|
||||
I18n.translations = I18n.translations || {};
|
||||
<% I18n::JS::translations.each do |k,v| %>
|
||||
<% I18n::JS::translations.select{|k,v| Houdini.intl.available_locales.map{|i| i.to_s}.include?(k.to_s)}.each do |k,v| %>
|
||||
I18n.translations['<%= k %>'] = I18n.extend((I18n.translations['<%= k %>'] || {}),<%= JSON.generate(v) %>);
|
||||
<% end %>
|
||||
module.exports = I18n;
|
Loading…
Reference in a new issue