Skip to content

Commit

Permalink
Updated transifex script.
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
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
  • Loading branch information
mkarolin committed Jul 11, 2019
1 parent d980ed2 commit 5d67e49
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions script/lib/transifex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit 5d67e49

Please sign in to comment.