i18n_generators 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.8.1
2
+
3
+ * bugfixes:
4
+ * Fix for pluralized translations (scambra)
5
+
1
6
  == 0.8.0
2
7
 
3
8
  * major enhancements:
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = I18n generators
2
2
 
3
- This gem plugin generates a set of locale files for Rails 2.2 i18n feature.
3
+ This gem plugin generates a set of locale files for Rails 2.2 and 2.3 i18n feature.
4
4
 
5
5
  * http://github.com/amatsuda/i18n_generators/tree/master
6
6
 
@@ -84,9 +84,7 @@ Executes 2 and 3 at once.
84
84
 
85
85
  * As a gem
86
86
 
87
- % sudo gem source http://gems.github.com
88
-
89
- % sudo gem install amatsuda-i18n_generators
87
+ % gem install i18n_generators
90
88
 
91
89
  * As a Rails plugin
92
90
 
@@ -101,4 +99,3 @@ Please be careful not to harm your network environment and CLDR website by runni
101
99
 
102
100
 
103
101
  Copyright (c) 2008 Akira Matsuda, released under the MIT license
104
-
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.8.1
@@ -69,7 +69,11 @@ module I18nGenerator::Generator
69
69
  yaml = YamlDocument.new("config/locales/translation_#{locale_name}.yml", locale_name)
70
70
  each_value [], translations do |parents, value|
71
71
  node = parents.inject(yaml[locale_name]) {|node, parent| node[parent]}
72
- node.value = value
72
+ if value.is_a? String
73
+ node.value = value
74
+ else
75
+ value.each {|key, val| node[key].value = val}
76
+ end
73
77
  end
74
78
  yaml
75
79
  end
@@ -93,11 +97,11 @@ module I18nGenerator::Generator
93
97
  Thread.pass
94
98
  if key.to_s.include? '.'
95
99
  key_prefix, key_suffix = key.to_s.split('.')[0...-1], key.to_s.split('.')[-1]
96
- existing_translation = I18n.t(key, :default => key_suffix, :locale => locale_name)
97
- key_prefix.inject(oh) {|h, k| h[k]}[key_suffix] = existing_translation != key_suffix ? existing_translation : translator.translate(key_suffix)
100
+ existing_translation = I18n.backend.send(:lookup, locale_name, key_suffix, key_prefix)
101
+ key_prefix.inject(oh) {|h, k| h[k]}[key_suffix] = existing_translation ? existing_translation : translator.translate(key_suffix)
98
102
  else
99
- existing_translation = I18n.t(key, :default => key, :locale => locale_name)
100
- oh[key] = existing_translation != key ? existing_translation : translator.translate(key)
103
+ existing_translation = I18n.backend.send(:lookup, locale_name, key)
104
+ oh[key] = existing_translation ? existing_translation : translator.translate(key)
101
105
  end
102
106
  end
103
107
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{i18n_generators}
8
- s.version = "0.8.0"
8
+ s.version = "0.8.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Akira Matsuda"]
12
- s.date = %q{2010-08-26}
12
+ s.date = %q{2010-10-23}
13
13
  s.description = %q{A Rails generator plugin & gem that generates Rails 2.2 and 2.3 I18n locale files for almost every known locale.}
14
14
  s.email = %q{ronnie@dio.jp}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_generators
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 0
10
- version: 0.8.0
9
+ - 1
10
+ version: 0.8.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Akira Matsuda
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-26 00:00:00 +09:00
18
+ date: 2010-10-23 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies: []
21
21