From 5d67e4934a22b85aa1ea808562a033efaf7d3163 Mon Sep 17 00:00:00 2001 From: Max Karolinskiy Date: Tue, 2 Jul 2019 12:04:17 -0400 Subject: [PATCH] Updated transifex script. - FP.FingerPrint now does utf-8 encoding internally and expects an unencoded string. - Added 2 grdp files to ignore list for upload: * os_settings_strings.grdp * xr_consent_ui_strings.grdp Chromium change for FP.FingerPrint: commit e85b8eb18c9431ada0bac5ef578a4ff36eb73093 Author: Raul Tambre Date: Mon Apr 29 20:49:55 2019 +0000 //tools/grit/grit/extern: Improve Python 3 support The scripts still work with Python 2. There are no intended behaviour changes. Bug: 941669 --- script/lib/transifex.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/lib/transifex.py b/script/lib/transifex.py index 026c6d4fe33f..ba33b446ac58 100644 --- a/script/lib/transifex.py +++ b/script/lib/transifex.py @@ -215,7 +215,9 @@ def get_grd_message_string_tags(grd_file_path): grd_base_path = os.path.dirname(grd_file_path) grd_part_filename = element.get('file') if grd_part_filename in ['chromeos_strings.grdp', - 'media_router_resources.grdp']: + 'media_router_resources.grdp', + 'os_settings_strings.grdp', + 'xr_consent_ui_strings.grdp']: continue grd_part_path = os.path.join(grd_base_path, grd_part_filename) part_output_elements = get_grd_message_string_tags(grd_part_path) @@ -234,7 +236,7 @@ def get_fingerprint_for_xtb(message_tag): string_ph.tail or '')) string_to_hash = (string_to_hash or '').strip().encode('utf-8') string_to_hash = clean_triple_quoted_string(string_to_hash) - fp = FP.FingerPrint(string_to_hash) + fp = FP.FingerPrint(string_to_hash.decode('utf-8')) meaning = (message_tag.get('meaning') if 'meaning' in message_tag.attrib else None) if meaning: