socialcast-i18n-js 4.0.0.rc1 → 4.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ module I18n
4
4
  MAJOR = 4
5
5
  MINOR = 0
6
6
  PATCH = 0
7
- STRING = "#{MAJOR}.#{MINOR}.#{PATCH}.rc1"
7
+ STRING = "#{MAJOR}.#{MINOR}.#{PATCH}.rc2"
8
8
  end
9
9
  end
10
10
  end
@@ -1,9 +1,8 @@
1
- <%# encoding: utf-8%>
2
-
3
- <% SimplesIdeias::I18n.assert_usable_configuration! %>
4
- var I18n = I18n || {};
5
- I18n.translations = <%=
6
- SimplesIdeias::I18n.translation_segments.each_with_object({}) do |(name, segment),translations|
7
- translations.merge!(segment)
8
- end.to_json
9
- %>;
1
+ //= require i18n
2
+ <%#encoding: utf-8 %>
3
+ <% translations = I18n::Js::Translator.new(I18n::Js.config[:only]).translations %>
4
+ <% current_locale = __FILE__[/translation\-(\w*)/, 1] %>
5
+ <% default_locale = Rails.application.config.i18n.default_locale %>
6
+ <% scoped_translation = translations.select { |locale, value| [nil, locale.to_s].include?(current_locale) } %>
7
+ <% scoped_translation = { current_locale.to_sym => translations[default_locale.to_sym].deep_merge(scoped_translation[current_locale.to_sym])} unless current_locale == default_locale %>
8
+ ;I18n.translations = <%= scoped_translation.to_json %>;