From 6a3e59b406bdf303d85679579f78fb805777e153 Mon Sep 17 00:00:00 2001 From: Bilka Date: Tue, 7 May 2024 10:39:23 +0200 Subject: [PATCH] Fix lint errors --- lib/i18n/tasks/translators/google_translator.rb | 2 +- spec/google_translate_spec.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/i18n/tasks/translators/google_translator.rb b/lib/i18n/tasks/translators/google_translator.rb index 10437390..5cc8f05a 100644 --- a/lib/i18n/tasks/translators/google_translator.rb +++ b/lib/i18n/tasks/translators/google_translator.rb @@ -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 diff --git a/spec/google_translate_spec.rb b/spec/google_translate_spec.rb index da801254..ab6ae61c 100644 --- a/spec/google_translate_spec.rb +++ b/spec/google_translate_spec.rb @@ -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 @@ -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