Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilka2 committed May 7, 2024
1 parent 4cae1c3 commit 6a3e59b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/i18n/tasks/translators/google_translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def options_for_translate_values(from:, to:, **options)
options.merge(
api_key: api_key,
from: from,
to: to,
to: to
)
end

Expand Down
16 changes: 8 additions & 8 deletions spec/google_translate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
'config/locales/zh-tw.yml' => '',
'config/locales/zh-hant.yml' => '',
'config/locales/zh-hk.yml' => '',
'config/locales/es.yml' => '',
'config/locales/es.yml' => ''
)
end

Expand All @@ -99,18 +99,18 @@
task.data[:en] = build_tree('en' => { 'common' => { 'a' => 'λ', 'horse' => 'horse' } })

# Loading translations seems to require at least one existing value.
%w(zh zh-cn zh-hans zh-tw zh-hant zh-hk).each do |locale|
%w[zh zh-cn zh-hans zh-tw zh-hant zh-hk].each do |locale|
task.data[locale] = build_tree(locale => { 'common' => { 'a' => 'λ' } })
end

run_cmd 'translate-missing'

expect(task.t('common.horse', 'zh' )).to eq("马") # Simplified Chinese
expect(task.t('common.horse', 'zh-cn' )).to eq("马") # Simplified Chinese
expect(task.t('common.horse', 'zh-hans')).to eq("马") # Simplified Chinese
expect(task.t('common.horse', 'zh-tw' )).to eq("馬") # Traditional Chinese
expect(task.t('common.horse', 'zh-hant')).to eq("馬") # Traditional Chinese
expect(task.t('common.horse', 'zh-hk' )).to eq("馬") # Traditional Chinese
expect(task.t('common.horse', 'zh')).to eq('马') # Simplified Chinese
expect(task.t('common.horse', 'zh-cn')).to eq('马') # Simplified Chinese
expect(task.t('common.horse', 'zh-hans')).to eq('马') # Simplified Chinese
expect(task.t('common.horse', 'zh-tw')).to eq('馬') # Traditional Chinese
expect(task.t('common.horse', 'zh-hant')).to eq('馬') # Traditional Chinese
expect(task.t('common.horse', 'zh-hk')).to eq('馬') # Traditional Chinese
end
end
end
Expand Down

0 comments on commit 6a3e59b

Please sign in to comment.