r18n-rails 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
data/lib/r18n-rails.rb
CHANGED
@@ -41,8 +41,6 @@ module R18n
|
|
41
41
|
R18n::I18n.new(locales, R18n.default_places,
|
42
42
|
:off_filters => :untranslated, :on_filters => :untranslated_html)
|
43
43
|
end
|
44
|
-
|
45
|
-
::I18n.backend = R18n::Backend.new
|
46
44
|
end
|
47
45
|
|
48
46
|
# Clean cache and reload filters from ruby files in `app/i18n`.
|
@@ -50,6 +48,7 @@ module R18n
|
|
50
48
|
def reload_r18n
|
51
49
|
R18n.clear_cache!
|
52
50
|
R18n::Rails::Filters.reload!
|
51
|
+
R18n.get.try(:reload!)
|
53
52
|
end
|
54
53
|
end
|
55
54
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= number_to_currency(1000) %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
ru:
|
2
|
+
number:
|
3
|
+
format:
|
4
|
+
delimiter: ! ' '
|
5
|
+
precision: 3
|
6
|
+
separator: .
|
7
|
+
significant: false
|
8
|
+
strip_insignificant_zeros: false
|
9
|
+
precision:
|
10
|
+
format:
|
11
|
+
delimiter: ''
|
12
|
+
currency:
|
13
|
+
format:
|
14
|
+
delimiter: ! ' '
|
15
|
+
format: ! '%n %u'
|
16
|
+
precision: 2
|
17
|
+
separator: .
|
18
|
+
significant: false
|
19
|
+
strip_insignificant_zeros: false
|
20
|
+
unit: руб.
|
data/spec/rails_spec.rb
CHANGED
@@ -133,4 +133,11 @@ describe TestController, :type => :controller do
|
|
133
133
|
"<b> user.<span style=\"color: red\">[no_tr]</span>\n"
|
134
134
|
end
|
135
135
|
|
136
|
+
|
137
|
+
it "should work with Rails build-in herlpers" do
|
138
|
+
get :format
|
139
|
+
response.should be_success
|
140
|
+
response.body.should == "1 000.00 руб.\n"
|
141
|
+
end
|
142
|
+
|
136
143
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r18n-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
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: 2012-
|
12
|
+
date: 2012-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: r18n-rails-api
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.0
|
21
|
+
version: 1.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.0
|
29
|
+
version: 1.1.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: bundler
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- spec/app/app/i18n/ru.yml
|
177
177
|
- spec/app/app/mailers/test_mailer.rb
|
178
178
|
- spec/app/app/models/post.rb
|
179
|
+
- spec/app/app/views/test/format.html.erb
|
179
180
|
- spec/app/app/views/test/helpers.html.erb
|
180
181
|
- spec/app/app/views/test/safe.html.erb
|
181
182
|
- spec/app/app/views/test_mailer/test.text.erb
|
@@ -188,6 +189,7 @@ files:
|
|
188
189
|
- spec/app/config/initializers/secret_token.rb
|
189
190
|
- spec/app/config/initializers/session_store.rb
|
190
191
|
- spec/app/config/locales/en.yml
|
192
|
+
- spec/app/config/locales/ru.yml
|
191
193
|
- spec/app/config/routes.rb
|
192
194
|
- spec/app/db/migrate/20091218123631_create_posts.rb
|
193
195
|
- spec/app/db/schema.rb
|
@@ -208,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
210
|
version: '0'
|
209
211
|
segments:
|
210
212
|
- 0
|
211
|
-
hash:
|
213
|
+
hash: -3013323514127094399
|
212
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
215
|
none: false
|
214
216
|
requirements:
|
@@ -217,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
219
|
version: '0'
|
218
220
|
segments:
|
219
221
|
- 0
|
220
|
-
hash:
|
222
|
+
hash: -3013323514127094399
|
221
223
|
requirements: []
|
222
224
|
rubyforge_project:
|
223
225
|
rubygems_version: 1.8.23
|