Skip to content

Commit

Permalink
fix reading .ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
pejuko committed Apr 17, 2015
1 parent ad34b8f commit 77286b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.2.7
======
* fix reading .ts file

v0.2.6
======
* compatibility with i18n-0.7.0
Expand Down
4 changes: 3 additions & 1 deletion i18n-translators-tools.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec = Gem::Specification.new do |s|
s.email = "[email protected]"
s.authors = ["Petr Kovar"]
s.name = 'i18n-translators-tools'
s.version = '0.2.6'
s.version = '0.2.7'
s.date = Time.now.strftime("%Y-%m-%d")
s.add_dependency('i18n', '>= 0.7.0')
s.add_dependency('ya2yaml')
Expand Down Expand Up @@ -52,6 +52,8 @@ Functions:
* statistics
Changelog:
v0.2.7
* fix reading .ts file
v0.2.6
* compatible with i18n 0.7.0
* make it works with rails 4.2
Expand Down
6 changes: 4 additions & 2 deletions lib/i18n/processor/ts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ def import(data)
fuzzy = get(message, "translation", "type").to_s.strip
entry["flag"] = fuzzy if fuzzy == "obsolete"
entry["fuzzy"] = true unless fuzzy.empty?
flag = get(message, "extra-po-flags").to_s.strip
entry["flag"] = flag unless flag.empty?
if entry["fuzzy"]
flag = get(message, "extra-po-flags").to_s.strip
entry["flag"] = flag unless flag.empty?
end
entry.delete_if {|k,v| v.to_s.empty?}
if key
# not key means it can be header of po file converted to ts
Expand Down

0 comments on commit 77286b6

Please sign in to comment.