Skip to content

Commit b249b55

Browse files
committed
Sort empty keys in error message
1 parent 3754e1e commit b249b55

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ def self.validate_strings_file(destination)
3030
return unless File.exist?(destination) # If the file failed to download, don't try to validate an non-existing file. We'd already have a separate error for the download failure anyway.
3131

3232
translations = Fastlane::Helper::Ios::L10nHelper.read_strings_file_as_hash(path: destination)
33-
empty_keys = translations.select { |_, value| value.nil? || value.empty? }.keys
33+
empty_keys = translations.select { |_, value| value.nil? || value.empty? }.keys.sort
3434
unless empty_keys.empty?
3535
UI.error(
36-
"Found empty translations in `#{destination}` for the following keys: #{empty_keys}.\n" \
36+
"Found empty translations in `#{destination}` for the following keys: #{empty_keys.inspect}.\n" \
3737
+ "This is likely a GlotPress bug, and will lead to copies replaced by empty text in the UI.\n" \
3838
+ 'Please report this to the GlotPress team, and fix the file locally before continuing.'
3939
)
4040
end
4141
rescue StandardError => e
42-
UI.error("Error while validating the file exported from GlotPress (`#{destination}`) - #{e.message}")
42+
UI.error("Error while validating the file exported from GlotPress (`#{destination}`) - #{e.message.chomp}")
4343
end
4444

4545
#####################################################

0 commit comments

Comments
 (0)