lost_in_translation 0.2.9 → 0.2.10

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: 73c145fb5f7be5e482a29be613f463cab011806f
4
- data.tar.gz: 429208718f0b933fec0391ae7fed08f7e1232235
3
+ metadata.gz: 1075e789fd4de6e65635ff9a8133487f72570884
4
+ data.tar.gz: f83ed48c0f6217e5a861644bc63bc959ac6b40a7
5
5
  SHA512:
6
- metadata.gz: db810aa214ba439bdcd7da7a9c02c93b93feeac849c8bfbbe010e93b589b5f535c343e35c0019ca4eb9e4f86caaa0fceb8eb798c958795cb9b8c64019000db76
7
- data.tar.gz: 8ca66d5e0293cf78c6839573564707da5e14b86b736ec4c03bc3cf11dacfabf2a9eb6cfaef8e5cd31ae9911d5ef8bb92701b7c78a0e9d7998a074211275af8d0
6
+ metadata.gz: c36f01b401213ed13fac46795dc6aa55bfe715ed1b6c61af51c8cc17c8fc58be8503fd1830a975716924f63fe54fe1e62b0a8b1c782622417ab81bc43fd6b0cd
7
+ data.tar.gz: 3897f58e79dee4c55782e58b11e5bcd1c81a890ab7da9b29bfc593bcfee10faa3105559b6d06b4fdcacd28cc5be2ae8a45491986fbed98e89b02ccdcf9691bfc
@@ -3,17 +3,17 @@
3
3
  #
4
4
  module LostInTranslation
5
5
  def self.diff(root, compared, lang1, lang2, structure = [], new_array = [], options = {})
6
- @slave_file = options[:slave_file]
7
- @mode = options[:mode] # replace, clean, count
8
- @diff_count = options[:diff_count]
9
- @diff_counter = options[:diff_counter]
6
+ @slave_file = options[:slave_file] || ''
7
+ @mode = options[:mode] || 'count' # replace, clean, count
8
+ @diff_count = options[:diff_count] || 0
9
+ @diff_counter = options[:diff_counter] || 0
10
10
  root.each_pair do |key, value|
11
11
  next_root = root[key]
12
12
  next_compared = compared.nil? ? nil : compared[key]
13
13
  new_structure = structure.dup << key
14
14
  if value.is_a?(String) && (compared.nil? || compared[key].nil?)
15
15
  @diff_counter += 1
16
- if @mode == 'replace' && value_missing(options[:slave_file], new_structure)
16
+ if @mode == 'replace' && value_missing(@slave_file, new_structure)
17
17
  new_val = ask_for_translation(value, new_structure, lang1, lang2, @diff_count, @diff_counter)
18
18
  return new_array if new_val.present? && new_val.end_with?('exit')
19
19
  new_array << new_val unless new_val.nil?
@@ -2,5 +2,5 @@
2
2
 
3
3
  #
4
4
  module LostInTranslation
5
- VERSION = '0.2.9'
5
+ VERSION = '0.2.10'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lost_in_translation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datyv