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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e43070b335b7174bf71fbb327f5fd561e4ea3138
4
- data.tar.gz: 71c72e671bdb466f1ab9a5d4dd4ff04855e176e4
3
+ metadata.gz: 2d656c6c979ce8bab9ed66ae11e06f58b3aa00c9
4
+ data.tar.gz: 3f32570dc0f6cf2469e40f4e3359d78b9cba8fc0
5
5
  SHA512:
6
- metadata.gz: 9c153f4b4a9b558445d11ebe3f8b0457ae74e5b0a27a120ff94e720c522e033fd4595d8632097db1f79318c2cc5ee9e5471bc0adbe413f20f356c68993806b6a
7
- data.tar.gz: 4509cddc233d9f337c0216c29d29aaeac21337a232a925853255ac461767d97e4aecd4d6405e9bfd10fcc910c122591098dba04fc80d953f824675dcf27f1597
6
+ metadata.gz: 23839f14a19b7acc1ead489d40f0ecc1e985377d9d9844e979c9ab899d952b52109bc71868561345550d4fe186746bb7894664e9a1d0ce012c1bfc5bb566a160
7
+ data.tar.gz: 797cbb3c53ebf1cd2c99e6198574deaf653dcb1b1ce1c48606c963eaf7afa4e2c40b6c3bf7790afe6e101256e0aa5b39645bd98895822219f9185ad35ffebde4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gettext_simple"
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
@@ -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
 
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext_simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen