gettext_simple 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/gettext_simple.gemspec +1 -1
- data/lib/gettext_simple.rb +2 -2
- data/spec/gettext_simple_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d656c6c979ce8bab9ed66ae11e06f58b3aa00c9
|
4
|
+
data.tar.gz: 3f32570dc0f6cf2469e40f4e3359d78b9cba8fc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23839f14a19b7acc1ead489d40f0ecc1e985377d9d9844e979c9ab899d952b52109bc71868561345550d4fe186746bb7894664e9a1d0ce012c1bfc5bb566a160
|
7
|
+
data.tar.gz: 797cbb3c53ebf1cd2c99e6198574deaf653dcb1b1ce1c48606c963eaf7afa4e2c40b6c3bf7790afe6e101256e0aa5b39645bd98895822219f9185ad35ffebde4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/gettext_simple.gemspec
CHANGED
data/lib/gettext_simple.rb
CHANGED
@@ -74,14 +74,14 @@ class GettextSimple
|
|
74
74
|
raise "Locale was not found: '#{locale}' in '#{@locales.keys.join(", ")}'." unless @locales.key?(locale)
|
75
75
|
|
76
76
|
if !@locales[locale].key?(str)
|
77
|
-
translated_str = str
|
77
|
+
translated_str = str.to_s
|
78
78
|
else
|
79
79
|
translated_str = @locales[locale][str]
|
80
80
|
end
|
81
81
|
|
82
82
|
if replaces
|
83
83
|
replaces.each do |key, val|
|
84
|
-
translated_str = translated_str.gsub("%{#{key}}", val)
|
84
|
+
translated_str = translated_str.gsub("%{#{key}}", val.to_s)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
data/spec/gettext_simple_spec.rb
CHANGED
@@ -68,4 +68,9 @@ describe "GettextSimple" do
|
|
68
68
|
it "should ignore empty translations" do
|
69
69
|
@gs.instance_variable_get(:@locales)["da"].keys.should_not include "empty translation"
|
70
70
|
end
|
71
|
+
|
72
|
+
it "should translate integers with replacements" do
|
73
|
+
@gs.translate(1, :name => "kasper")
|
74
|
+
@gs.translate("hejsa", :name => 5)
|
75
|
+
end
|
71
76
|
end
|