r18n-core 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +3 -0
- data/lib/r18n-core/filters.rb +1 -3
- data/lib/r18n-core/translated_string.rb +6 -4
- data/lib/r18n-core/translation.rb +1 -1
- data/lib/r18n-core/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ff840b9a7642dd18fca8af6172a1fc3cc859e5
|
4
|
+
data.tar.gz: c2fd43948dcbf36b58a43016cc98ee624fe90ebc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5167736c090fca6199ab4e0c8ec06142287fbf87c2ae24e3b1dbecc874e398a47872cd55e75feee6560c2253a7121eb622b09f432ebc3525acfeffc9bf2714d9
|
7
|
+
data.tar.gz: 3079adcd2fea7198e10185f7d2510e3878cb91fbd51702d5075d731e219784f9df447975dd9150c0cfcf676a28491cca18e88fcdbc149a284e8c2edf7509b5b2
|
data/ChangeLog.md
CHANGED
data/lib/r18n-core/filters.rb
CHANGED
@@ -230,8 +230,7 @@ module R18n
|
|
230
230
|
|
231
231
|
Filters.add(String, :variables) do |content, config, *params|
|
232
232
|
cached_params = []
|
233
|
-
content
|
234
|
-
content.gsub!(/\%\d/) do |key|
|
233
|
+
content.to_s.gsub(/\%\d/) do |key|
|
235
234
|
i = key[1..-1].to_i
|
236
235
|
unless cached_params.include? i - 1
|
237
236
|
param = config[:locale].localize(params[i - 1])
|
@@ -243,7 +242,6 @@ module R18n
|
|
243
242
|
end
|
244
243
|
cached_params[i - 1]
|
245
244
|
end
|
246
|
-
content
|
247
245
|
end
|
248
246
|
|
249
247
|
Filters.add(Untranslated, :untranslated) do |v, c, translated, untranslated|
|
@@ -28,10 +28,12 @@ module R18n
|
|
28
28
|
|
29
29
|
# Returns a new string object containing a copy of +str+, which translated
|
30
30
|
# for +path+ to +locale+
|
31
|
-
def initialize(
|
32
|
-
|
31
|
+
def initialize(value, locale, path, filters = nil)
|
32
|
+
value = value.to_s if value.is_a? TranslatedString
|
33
|
+
super(value)
|
33
34
|
@filters = filters
|
34
35
|
@locale = locale
|
36
|
+
@value = value
|
35
37
|
@path = path
|
36
38
|
end
|
37
39
|
|
@@ -53,9 +55,9 @@ module R18n
|
|
53
55
|
# Override to_s to make string html safe if `html_safe` method is defined.
|
54
56
|
def to_s
|
55
57
|
if respond_to? :html_safe
|
56
|
-
html_safe
|
58
|
+
@value.html_safe
|
57
59
|
else
|
58
|
-
|
60
|
+
@value
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
@@ -93,7 +93,7 @@ module R18n
|
|
93
93
|
when String
|
94
94
|
c = { locale: locale, path: path }
|
95
95
|
v = @filters.process_string(:passive, value, c, [])
|
96
|
-
value = TranslatedString.new(v, locale, path, @
|
96
|
+
value = TranslatedString.new(v, locale, path, @filter)
|
97
97
|
when Typed
|
98
98
|
value.locale = locale
|
99
99
|
value.path = path
|
data/lib/r18n-core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r18n-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Sitnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
R18n is a i18n tool to translate your Ruby application.
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.
|
170
|
+
rubygems_version: 2.5.1
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: I18n tool to translate your Ruby application.
|