i18n-extra_translations 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,11 +2,21 @@ module I18n
2
2
  class ExtraTranslations
3
3
  class Server
4
4
  def call(env)
5
+ reload_mt(I18n::ExtraTranslations.missing_translations)
5
6
  [ 200, { "Content-Type" => "text/plain" }, [ mt_view(I18n::ExtraTranslations.missing_translations) ] ]
6
7
  end
7
8
 
8
9
  protected
9
10
 
11
+ def reload_mt(mt)
12
+ return unless mt.kind_of? Array
13
+ I18n.backend.reload!
14
+ mt.each do |key|
15
+ keys = key.split('.') ; keys.shift
16
+ I18n.translate(keys.join('.'))
17
+ end
18
+ end
19
+
10
20
  def mt_view(mt)
11
21
  if mt.nil? || mt.empty?
12
22
  'No missing translations found' if mt.nil? || mt.empty?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-extra_translations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-12 00:00:00.000000000 Z
12
+ date: 2013-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
@@ -52,7 +52,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
52
  version: '0'
53
53
  segments:
54
54
  - 0
55
- hash: -2496943000659112162
55
+ hash: 546678142041760686
56
56
  required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  version: '0'
62
62
  segments:
63
63
  - 0
64
- hash: -2496943000659112162
64
+ hash: 546678142041760686
65
65
  requirements: []
66
66
  rubyforge_project:
67
67
  rubygems_version: 1.8.23