r18n-core 2.1.7 → 2.1.8
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/translation.rb +4 -1
- data/lib/r18n-core/version.rb +1 -1
- data/spec/translation_spec.rb +7 -0
- data/spec/translations/general/en.yml +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bbaa39e76a973790722f6ff6bc226c48f431f81
|
4
|
+
data.tar.gz: 4d8d2cdc188540d8a5740e63f06c0105efbaf370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb03b1cf8bba47d9a6fc74d4f7226e0e313cf53eac972bac848f5b3c8b032f8da3b29a9ceec96ff8cf86aa1b61aa3e195f5223699b615e880aec147fa023750b
|
7
|
+
data.tar.gz: 3cd414164ccfe5cafdc076acfdf3a0f3e2f4408a58e37709ce54d63cdf1a36e51d051c931e36fceceec0d462eb5b860a8043c9b794d4d0a46da70ae2dc26f10c
|
data/ChangeLog.md
CHANGED
@@ -145,7 +145,10 @@ module R18n
|
|
145
145
|
# Translation can contain variable part. Just set is as <tt>%1</tt>,
|
146
146
|
# <tt>%2</tt>, etc in translations file and set values in next +params+.
|
147
147
|
def [](name, *params)
|
148
|
-
|
148
|
+
unless [String, Integer, TrueClass, FalseClass]
|
149
|
+
.any? { |klass| name.is_a?(klass) }
|
150
|
+
name = name.to_s
|
151
|
+
end
|
149
152
|
value = @data[name]
|
150
153
|
case value
|
151
154
|
when TranslatedString
|
data/lib/r18n-core/version.rb
CHANGED
data/spec/translation_spec.rb
CHANGED
@@ -33,6 +33,13 @@ describe R18n::Translation do
|
|
33
33
|
expect(i18n.one.split.first.to_s).to be_kind_of(String)
|
34
34
|
end
|
35
35
|
|
36
|
+
it "returns strings by Boolean keys (true, false)" do
|
37
|
+
i18n = R18n::I18n.new('en', DIR)
|
38
|
+
|
39
|
+
expect(i18n.boolean[true]).to eq('Boolean is true')
|
40
|
+
expect(i18n.boolean[false]).to eq('Boolean is false')
|
41
|
+
end
|
42
|
+
|
36
43
|
it "returns html escaped string" do
|
37
44
|
klass = Class.new(R18n::TranslatedString) do
|
38
45
|
def html_safe
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Sitnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
R18n is a i18n tool to translate your Ruby application.
|