Browse Source

Maintenance: Update dependency rubocop to v1.71.0

renovatebot 1 month ago
parent
commit
fc3bd1c157

+ 1 - 1
Gemfile.lock

@@ -567,7 +567,7 @@ GEM
       rspec-core (> 3.3)
     rspec-support (3.13.2)
     rszr (1.5.0)
-    rubocop (1.70.0)
+    rubocop (1.71.0)
       json (~> 2.3)
       language_server-protocol (>= 3.17.0)
       parallel (~> 1.10)

+ 1 - 3
lib/generators/zammad/translation_catalog/writer/chat.rb

@@ -56,9 +56,7 @@ class Zammad::TranslationCatalog::Writer::Chat < Zammad::TranslationCatalog::Wri
   end
 
   def translations(sources, locale)
-    string_map = Translation.cached_strings_for_locale(locale).select do |source, _entry|
-      sources.include?(source)
-    end.transform_values(&:translation)
+    string_map = Translation.cached_strings_for_locale(locale).slice(*sources).transform_values(&:translation)
 
     # Add strings that might be missing from translation file.
     (sources - string_map.keys).each do |missing_source|

+ 1 - 3
lib/generators/zammad/translation_catalog/writer/form_js.rb

@@ -55,9 +55,7 @@ class Zammad::TranslationCatalog::Writer::FormJs < Zammad::TranslationCatalog::W
   end
 
   def translations(sources, locale)
-    string_map = Translation.cached_strings_for_locale(locale).select do |source, _entry|
-      sources.include?(source)
-    end.transform_values(&:translation)
+    string_map = Translation.cached_strings_for_locale(locale).slice(*sources).transform_values(&:translation)
 
     # Add strings that might be missing from translation file.
     (sources - string_map.keys).each do |missing_source|