Skip to content

Commit

Permalink
Remove Transifex localizers power to mess up l10n in Brave
Browse files Browse the repository at this point in the history
  • Loading branch information
bbondy committed Jan 17, 2019
1 parent 7e7e112 commit 9723ddc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"description": "We show this string in notification when tip fails"
},
"noActivity": {
"message": "Pas encore d\'activité…",
"message": "Pas encore d'activité…",
"description": "Allows the user to see that there have been no transactions or other activity in their wallet"
},
"captchaDrag": {
Expand Down
13 changes: 10 additions & 3 deletions script/lib/transifex.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,16 @@ def get_transifex_translation_file_content(source_file_path, filename,
'Aborting. Status code %d: %s' % (r.status_code, r.content))
content = r.json()['content'].encode('utf-8')
ext = os.path.splitext(source_file_path)[1]
# For .grd files, for some reason Transifex puts a \\" and \'
if ext == '.grd':
return content.replace('\\"', '"').replace("\\'", "'")
if ext == '.json':
# For .json files, for some reason Transifex puts a \'
content = content.replace("\\'", "'")
# Make sure it's parseable
json.loads(content)
elif ext == '.grd':
# For .grd and .json files, for some reason Transifex puts a \\" and \'
content = content.replace('\\"', '"').replace("\\'", "'")
# Make sure it's parseable
lxml.etree.fromstring(content)
return content


Expand Down

0 comments on commit 9723ddc

Please sign in to comment.