From f4ce402dc4fda28abf7b16a9c3877cedde27346f Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Tue, 31 Jan 2023 16:53:24 +0100 Subject: [PATCH] DEV: `i18n:check` rake task was broken on Ruby 3.1 (#20103) `server.en.yml` contains aliases and Ruby 3.1 made changes to `YAML.load_file`. see https://www.ctrl.blog/entry/ruby-psych4.html --- lib/i18n/locale_file_checker.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/i18n/locale_file_checker.rb b/lib/i18n/locale_file_checker.rb index e7d71ece03..e0aa83028f 100644 --- a/lib/i18n/locale_file_checker.rb +++ b/lib/i18n/locale_file_checker.rb @@ -19,8 +19,8 @@ class LocaleFileChecker @relative_locale_path = Pathname.new(locale_path).relative_path_from(Pathname.new(Rails.root)).to_s - @locale_yaml = YAML.load_file(locale_path) - @reference_yaml = YAML.load_file(reference_path) + @locale_yaml = YAML.load_file(locale_path, aliases: true) + @reference_yaml = YAML.load_file(reference_path, aliases: true) next if @locale_yaml.blank? || @locale_yaml.first[1].blank?