gettext_simple 0.0.3 → 0.0.4

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: 2eb895e7961ef32eac71be8e4028e1e7e36f2a4c
4
- data.tar.gz: 3b2c03860b4885c1ac2280bdd11204b5eabaffb1
3
+ metadata.gz: 160fe8d8a9f477f0b81264bc7505a02dc015b10b
4
+ data.tar.gz: c29d0a464ca361ad747ea9e018dbd803d113176d
5
5
  SHA512:
6
- metadata.gz: 18e7bc4d0eeb9345ff621578cc4dcd6f48ab4fc634e6669337f6c21f592bc426d3e9191ebea0e64b031cee823fd0f2d14cf3a6ac6cfe9d5b8a91345e4f83153a
7
- data.tar.gz: 998471cc897a4d57d2db5b0479a848e7ab630c40fef6dd123287471f7461aa94320bf22fd17dfe3d5e9c694e6acca7507624c1d47b685abbe33d2262f0281617
6
+ metadata.gz: 20b8d3e2847981c4b12f9c99fd7cc7659f45c03316b08a8f29cb26a5a252e6fdf330c5ba5a393a8003a3c3f6368831fe579e1eb66a802588abb039e5c4c8c0b3
7
+ data.tar.gz: dd48e51243a04a8b5d06f1b0c08b4288e11c3beff410c4e2723f617677a32041756a1327a64d4269cb0300ac09bff56308d45a0db98ff2aa52ff190d4a3a2607
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gettext_simple"
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
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"]
@@ -146,14 +146,10 @@ private
146
146
 
147
147
  add_translation(locale, current_id, current_translation) if reading_translation
148
148
  end
149
-
150
- #cont.scan(/msgid\s+\"(.+)\"(\r|)\nmsgstr\s+\"(.+)\"(\r|)\n(\r|)\n/) do |match|
151
- # @locales[locale][match[0]] = match[2].to_s.encode("utf-8")
152
- #end
153
149
  end
154
150
 
155
151
  def add_translation(locale, key, val)
156
152
  raise "No such language: '#{locale}'." unless @locales.key?(locale)
157
- @locales[locale][key] = val
153
+ @locales[locale][key] = val unless val.to_s.empty?
158
154
  end
159
155
  end
@@ -19,6 +19,10 @@ describe "GettextSimple" do
19
19
  fp.puts "\"test mange\"\n"
20
20
  fp.puts "\" linjer\"\n"
21
21
  fp.puts "\n"
22
+
23
+ fp.puts "msgid \"empty translation\"\n"
24
+ fp.puts "msgstr \"\"\n"
25
+ fp.puts "\n"
22
26
  end
23
27
 
24
28
  @gs = GettextSimple.new
@@ -60,4 +64,8 @@ describe "GettextSimple" do
60
64
 
61
65
  da[test_key].should eq test_value
62
66
  end
67
+
68
+ it "should ignore empty translations" do
69
+ @gs.instance_variable_get(:@locales)["da"].keys.should_not include "empty translation"
70
+ end
63
71
  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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen