i18n 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of i18n might be problematic. Click here for more details.

Files changed (77) hide show
  1. data/README.textile +44 -9
  2. data/Rakefile +2 -1
  3. data/VERSION +1 -1
  4. data/lib/i18n.rb +60 -15
  5. data/lib/i18n/backend.rb +14 -0
  6. data/lib/i18n/backend/active_record.rb +69 -0
  7. data/lib/i18n/backend/active_record/store_procs.rb +37 -0
  8. data/lib/i18n/backend/active_record/translation.rb +82 -0
  9. data/lib/i18n/backend/active_record_missing.rb +55 -0
  10. data/lib/i18n/backend/base.rb +235 -0
  11. data/lib/i18n/backend/cache.rb +71 -0
  12. data/lib/i18n/backend/chain.rb +74 -0
  13. data/lib/i18n/backend/fallbacks.rb +51 -0
  14. data/lib/i18n/backend/gettext.rb +75 -0
  15. data/lib/i18n/backend/helpers.rb +53 -0
  16. data/lib/i18n/backend/metadata.rb +73 -0
  17. data/lib/i18n/backend/pluralization.rb +57 -0
  18. data/lib/i18n/backend/simple.rb +15 -227
  19. data/lib/i18n/core_ext/object/meta_class.rb +5 -0
  20. data/lib/i18n/{string.rb → core_ext/string/interpolate.rb} +2 -0
  21. data/lib/i18n/exceptions.rb +2 -0
  22. data/lib/i18n/gettext.rb +25 -0
  23. data/lib/i18n/helpers.rb +5 -0
  24. data/lib/i18n/helpers/gettext.rb +64 -0
  25. data/lib/i18n/locale.rb +6 -0
  26. data/lib/i18n/locale/fallbacks.rb +98 -0
  27. data/lib/i18n/locale/tag.rb +28 -0
  28. data/lib/i18n/locale/tag/parents.rb +24 -0
  29. data/lib/i18n/locale/tag/rfc4646.rb +76 -0
  30. data/lib/i18n/locale/tag/simple.rb +41 -0
  31. data/test/all.rb +7 -2
  32. data/test/api/basics.rb +3 -1
  33. data/test/api/interpolation.rb +35 -4
  34. data/test/api/lambda.rb +5 -3
  35. data/test/api/link.rb +4 -2
  36. data/test/api/localization/date.rb +2 -0
  37. data/test/api/localization/date_time.rb +3 -1
  38. data/test/api/localization/lambda.rb +4 -2
  39. data/test/api/localization/time.rb +3 -1
  40. data/test/api/pluralization.rb +12 -15
  41. data/test/api/translation.rb +5 -3
  42. data/test/backend/active_record/active_record_test.rb +40 -0
  43. data/test/backend/active_record/all.rb +3 -0
  44. data/test/backend/active_record/api_test.rb +54 -0
  45. data/test/backend/active_record/setup.rb +166 -0
  46. data/test/backend/active_record_missing/active_record_missing_test.rb +63 -0
  47. data/test/backend/all/api_test.rb +88 -0
  48. data/test/backend/cache/cache_test.rb +69 -0
  49. data/test/backend/chain/api_test.rb +80 -0
  50. data/test/backend/chain/chain_test.rb +64 -0
  51. data/test/backend/fallbacks/api_test.rb +84 -0
  52. data/test/backend/fallbacks/fallbacks_test.rb +57 -0
  53. data/test/backend/metadata/metadata_test.rb +65 -0
  54. data/test/backend/pluralization/api_test.rb +86 -0
  55. data/test/backend/pluralization/pluralization_test.rb +43 -0
  56. data/test/backend/simple/all.rb +2 -0
  57. data/test/backend/simple/api_test.rb +27 -20
  58. data/test/backend/simple/helpers_test.rb +26 -0
  59. data/test/backend/simple/lookup_test.rb +2 -1
  60. data/test/backend/simple/{setup/localization.rb → setup.rb} +29 -11
  61. data/test/backend/simple/translations_test.rb +1 -6
  62. data/test/{string_test.rb → core_ext/string/interpolate_test.rb} +4 -2
  63. data/test/fixtures/locales/de.po +67 -0
  64. data/test/fixtures/locales/en.rb +2 -0
  65. data/test/fixtures/locales/plurals.rb +113 -0
  66. data/test/gettext/api_test.rb +204 -0
  67. data/test/gettext/backend_test.rb +84 -0
  68. data/test/i18n_exceptions_test.rb +3 -1
  69. data/test/i18n_load_path_test.rb +8 -1
  70. data/test/i18n_test.rb +30 -7
  71. data/test/locale/fallbacks_test.rb +128 -0
  72. data/test/locale/tag/rfc4646_test.rb +145 -0
  73. data/test/locale/tag/simple_test.rb +35 -0
  74. data/test/test_helper.rb +11 -5
  75. data/test/with_options.rb +2 -0
  76. metadata +75 -11
  77. data/test/backend/simple/setup/base.rb +0 -21
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # this is only here so we can test I18n works nicely with ActiveSupports
2
4
  # with_options. Maybe we can just remove it?
3
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2009-07-12 00:00:00 +02:00
16
+ date: 2009-11-30 00:00:00 +01:00
17
17
  default_executable:
18
18
  dependencies: []
19
19
 
@@ -32,9 +32,32 @@ files:
32
32
  - Rakefile
33
33
  - VERSION
34
34
  - lib/i18n.rb
35
+ - lib/i18n/backend.rb
36
+ - lib/i18n/backend/active_record.rb
37
+ - lib/i18n/backend/active_record/store_procs.rb
38
+ - lib/i18n/backend/active_record/translation.rb
39
+ - lib/i18n/backend/active_record_missing.rb
40
+ - lib/i18n/backend/base.rb
41
+ - lib/i18n/backend/cache.rb
42
+ - lib/i18n/backend/chain.rb
43
+ - lib/i18n/backend/fallbacks.rb
44
+ - lib/i18n/backend/gettext.rb
45
+ - lib/i18n/backend/helpers.rb
46
+ - lib/i18n/backend/metadata.rb
47
+ - lib/i18n/backend/pluralization.rb
35
48
  - lib/i18n/backend/simple.rb
49
+ - lib/i18n/core_ext/object/meta_class.rb
50
+ - lib/i18n/core_ext/string/interpolate.rb
36
51
  - lib/i18n/exceptions.rb
37
- - lib/i18n/string.rb
52
+ - lib/i18n/gettext.rb
53
+ - lib/i18n/helpers.rb
54
+ - lib/i18n/helpers/gettext.rb
55
+ - lib/i18n/locale.rb
56
+ - lib/i18n/locale/fallbacks.rb
57
+ - lib/i18n/locale/tag.rb
58
+ - lib/i18n/locale/tag/parents.rb
59
+ - lib/i18n/locale/tag/rfc4646.rb
60
+ - lib/i18n/locale/tag/simple.rb
38
61
  - test/all.rb
39
62
  - test/api/basics.rb
40
63
  - test/api/interpolation.rb
@@ -46,18 +69,39 @@ files:
46
69
  - test/api/localization/time.rb
47
70
  - test/api/pluralization.rb
48
71
  - test/api/translation.rb
72
+ - test/backend/active_record/active_record_test.rb
73
+ - test/backend/active_record/all.rb
74
+ - test/backend/active_record/api_test.rb
75
+ - test/backend/active_record/setup.rb
76
+ - test/backend/active_record_missing/active_record_missing_test.rb
77
+ - test/backend/all/api_test.rb
78
+ - test/backend/cache/cache_test.rb
79
+ - test/backend/chain/api_test.rb
80
+ - test/backend/chain/chain_test.rb
81
+ - test/backend/fallbacks/api_test.rb
82
+ - test/backend/fallbacks/fallbacks_test.rb
83
+ - test/backend/metadata/metadata_test.rb
84
+ - test/backend/pluralization/api_test.rb
85
+ - test/backend/pluralization/pluralization_test.rb
49
86
  - test/backend/simple/all.rb
50
87
  - test/backend/simple/api_test.rb
88
+ - test/backend/simple/helpers_test.rb
51
89
  - test/backend/simple/lookup_test.rb
52
- - test/backend/simple/setup/base.rb
53
- - test/backend/simple/setup/localization.rb
90
+ - test/backend/simple/setup.rb
54
91
  - test/backend/simple/translations_test.rb
92
+ - test/core_ext/string/interpolate_test.rb
93
+ - test/fixtures/locales/de.po
55
94
  - test/fixtures/locales/en.rb
56
95
  - test/fixtures/locales/en.yml
96
+ - test/fixtures/locales/plurals.rb
97
+ - test/gettext/api_test.rb
98
+ - test/gettext/backend_test.rb
57
99
  - test/i18n_exceptions_test.rb
58
100
  - test/i18n_load_path_test.rb
59
101
  - test/i18n_test.rb
60
- - test/string_test.rb
102
+ - test/locale/fallbacks_test.rb
103
+ - test/locale/tag/rfc4646_test.rb
104
+ - test/locale/tag/simple_test.rb
61
105
  - test/test_helper.rb
62
106
  - test/with_options.rb
63
107
  has_rdoc: true
@@ -83,10 +127,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
127
  version:
84
128
  requirements: []
85
129
 
86
- rubyforge_project:
130
+ rubyforge_project: i18n
87
131
  rubygems_version: 1.3.5
88
132
  signing_key:
89
- specification_version: 2
133
+ specification_version: 3
90
134
  summary: New wave Internationalization support for Ruby
91
135
  test_files:
92
136
  - test/all.rb
@@ -100,16 +144,36 @@ test_files:
100
144
  - test/api/localization/time.rb
101
145
  - test/api/pluralization.rb
102
146
  - test/api/translation.rb
147
+ - test/backend/active_record/active_record_test.rb
148
+ - test/backend/active_record/all.rb
149
+ - test/backend/active_record/api_test.rb
150
+ - test/backend/active_record/setup.rb
151
+ - test/backend/active_record_missing/active_record_missing_test.rb
152
+ - test/backend/all/api_test.rb
153
+ - test/backend/cache/cache_test.rb
154
+ - test/backend/chain/api_test.rb
155
+ - test/backend/chain/chain_test.rb
156
+ - test/backend/fallbacks/api_test.rb
157
+ - test/backend/fallbacks/fallbacks_test.rb
158
+ - test/backend/metadata/metadata_test.rb
159
+ - test/backend/pluralization/api_test.rb
160
+ - test/backend/pluralization/pluralization_test.rb
103
161
  - test/backend/simple/all.rb
104
162
  - test/backend/simple/api_test.rb
163
+ - test/backend/simple/helpers_test.rb
105
164
  - test/backend/simple/lookup_test.rb
106
- - test/backend/simple/setup/base.rb
107
- - test/backend/simple/setup/localization.rb
165
+ - test/backend/simple/setup.rb
108
166
  - test/backend/simple/translations_test.rb
167
+ - test/core_ext/string/interpolate_test.rb
109
168
  - test/fixtures/locales/en.rb
169
+ - test/fixtures/locales/plurals.rb
170
+ - test/gettext/api_test.rb
171
+ - test/gettext/backend_test.rb
110
172
  - test/i18n_exceptions_test.rb
111
173
  - test/i18n_load_path_test.rb
112
174
  - test/i18n_test.rb
113
- - test/string_test.rb
175
+ - test/locale/fallbacks_test.rb
176
+ - test/locale/tag/rfc4646_test.rb
177
+ - test/locale/tag/simple_test.rb
114
178
  - test/test_helper.rb
115
179
  - test/with_options.rb
@@ -1,21 +0,0 @@
1
- module Tests
2
- module Backend
3
- module Simple
4
- module Setup
5
- module Base
6
- def setup
7
- super
8
- I18n.backend = I18n::Backend::Simple.new
9
- backend_store_translations :en, :foo => {:bar => 'bar', :baz => 'baz'}
10
- end
11
-
12
- def teardown
13
- super
14
- I18n.load_path = []
15
- I18n.backend = nil
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end