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.
- data/lib/i18n/js/version.rb +1 -1
- data/vendor/assets/javascripts/i18n/translations.js.erb +8 -9
- data/vendor/assets/javascripts/i18n.js +587 -457
- metadata +17 -24
- data/app/assets/javascripts/i18n/translations.js.erb +0 -6
- data/app/assets/javascripts/i18n.js +0 -661
- data/lib/i18n-js/engine.rb +0 -63
- data/lib/i18n-js/middleware.rb +0 -59
- data/lib/i18n-js/railtie.rb +0 -13
- data/lib/i18n-js/rake.rb +0 -16
- data/lib/i18n-js/version.rb +0 -10
data/lib/i18n/js/version.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<%
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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 %>;
|