From 29dfb39e5ee95a0fabd60be7b070c09722d452aa Mon Sep 17 00:00:00 2001 From: Lorenzo Mattei Date: Tue, 17 Jul 2018 15:20:58 +0200 Subject: [PATCH] Preserve translator comments when the metadata .po file is updated --- fastlane/actions/update_metadata_source.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fastlane/actions/update_metadata_source.rb b/fastlane/actions/update_metadata_source.rb index 30656990f7af..f0c33d32c4a0 100644 --- a/fastlane/actions/update_metadata_source.rb +++ b/fastlane/actions/update_metadata_source.rb @@ -97,6 +97,10 @@ def self.write_target_block(fw, line) end end + if (is_comment(line)) + @current_block = @blocks.first + end + @current_block.handle_line(fw, line) end @@ -104,6 +108,10 @@ def self.is_block_id(line) line.start_with?('msgctxt') end + def self.is_comment(line) + line.start_with?('#') + end + #####################################################