Class: I18nLinterRb::Linter

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_linter_rb/linter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_locale:, target_locale:) ⇒ Linter

Returns a new instance of Linter.



7
8
9
10
# File 'lib/i18n_linter_rb/linter.rb', line 7

def initialize(source_locale:, target_locale:)
  @source_locale = source_locale
  @target_locale = target_locale
end

Instance Attribute Details

#source_localeObject (readonly)

Returns the value of attribute source_locale.



5
6
7
# File 'lib/i18n_linter_rb/linter.rb', line 5

def source_locale
  @source_locale
end

#target_localeObject (readonly)

Returns the value of attribute target_locale.



5
6
7
# File 'lib/i18n_linter_rb/linter.rb', line 5

def target_locale
  @target_locale
end

Instance Method Details

#missing_keys_in_target(source_path, target_path) ⇒ Object



12
13
14
15
16
17
# File 'lib/i18n_linter_rb/linter.rb', line 12

def missing_keys_in_target(source_path, target_path)
  source_keys = locale_keys(source_path)
  target_keys = locale_keys(target_path)

  source_keys - target_keys
end