i18n-processes 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7297c979ac39120028d2a3c0950933d97e17ddc
4
- data.tar.gz: 80d0928db663600f639ac9cd0324461b7d64909d
3
+ metadata.gz: cb81a78309d5556c743ad0f8f526f6a3760bb6be
4
+ data.tar.gz: 3773c58a0c8d23b1b48090c0e5a16c8989f3d82e
5
5
  SHA512:
6
- metadata.gz: 29b142527dd9286e6e214bfcb5b35ea1dcc02aec6c3805f273ce75e77d1dd21b3359d341aa5a50c6dbd511dba6e94fc265e2caa846e876593e1fb908fed886c5
7
- data.tar.gz: 65effde8cae2368b77044d43af5b30d225174962dd247607edb4826d3899c2e19a6c27737de6c4b1793f6f68b572618b8950c70baa10c74bb046c3a312951782
6
+ metadata.gz: 2f1a07749479db3625a639dd5fce97e27db0447cb612bb25cd6a00ff7678eebb1efde54e607b058b5af1882ae0e4d0f4e8cdd76036c4b149874c8ce08282c440
7
+ data.tar.gz: 24329779ad753f76ce16c96e181f857809da8e9719e1a364c4d33695c0a877d439e74a4634b4f9e54e55a8520568a23b6462eb7ec00b64ef29b4e58a1b5a22e1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- i18n-processes (0.1.3)
4
+ i18n-processes (0.1.4)
5
5
  activesupport (>= 4.0.2)
6
6
  ast (>= 2.1.0)
7
7
  easy_translate (>= 0.5.1)
@@ -31,7 +31,6 @@ module I18n::Processes
31
31
  translated_locales = opt[:locales].reject{|x| x == base_locale}
32
32
  translated_locales.each do |locale|
33
33
  $stderr.puts Rainbow("#{base_locale} to #{locale}\n").green
34
- # 创建en,对比上一期,如果两者的差异一样或者en中不存在这些keys,没问题,不一样,则raise error
35
34
  preprocessing({:locales => [locale] })
36
35
  changed_keys(locale)
37
36
  missing_keys = spreadsheet_report.find_missing(locale)
@@ -34,14 +34,16 @@ module I18n::Processes:: Path
34
34
 
35
35
  def changed_keys(locale)
36
36
  previous = "#{compare_path.first}previous/pre_#{base_locale}"
37
- current = compare_path.first + base_locale
38
- locale_file = compare_path.first + locale
39
- previous_dic = get_dic(previous)
40
- current_dic = get_dic(current)
41
- locale_dic = get_dic(locale_file)
42
- diff = current_dic.merge(previous_dic){|k, v1, v2| {:current => v1, :previous => v2 } unless v1 == v2 }
43
- diff.select!{ |k, v| v.is_a?(Hash)}
44
- check_changed_keys(diff,locale_dic)
37
+ if File.exist?(previous)
38
+ current = compare_path.first + base_locale
39
+ locale_file = compare_path.first + locale
40
+ previous_dic = get_dic(previous)
41
+ current_dic = get_dic(current)
42
+ locale_dic = get_dic(locale_file)
43
+ diff = current_dic.merge(previous_dic){|k, v1, v2| {:current => v1, :previous => v2 } unless v1 == v2 }
44
+ diff.select!{ |k, v| v.is_a?(Hash)}
45
+ check_changed_keys(diff,locale_dic)
46
+ end
45
47
  end
46
48
 
47
49
  def check_changed_keys(diff, locale_dic)
@@ -68,7 +70,7 @@ module I18n::Processes:: Path
68
70
  end
69
71
 
70
72
  def get_dic(path)
71
- fail "#{path} not exist" unless File.exist?(path)
73
+ fail "#{path} not exist" unless File.exist?(path)
72
74
  {}.tap do |dic|
73
75
  File.open(path).each_line do |line|
74
76
  key = line.split('=').first
@@ -2,6 +2,6 @@
2
2
 
3
3
  module I18n
4
4
  module Processes
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-processes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucia