From 1d25188821e6d84bfefc6fd7a78cdf4dd491c12a Mon Sep 17 00:00:00 2001 From: Cosmin Humeniuc Date: Mon, 2 Oct 2023 15:00:29 +0300 Subject: [PATCH] Adapt locorestrings.py for Python 3 Signed-off-by: Cosmin Humeniuc Change-Id: I0328dc4cb97aa143fc2911255817b7cc636b5bec --- scripts/locorestrings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/locorestrings.py b/scripts/locorestrings.py index af7e2c9be1..42eba10632 100755 --- a/scripts/locorestrings.py +++ b/scripts/locorestrings.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # # This Source Code Form is subject to the terms of the Mozilla Public @@ -105,7 +105,7 @@ if __name__ == "__main__": poFile = dir + lang + '/svtools/messages.po' extractFromPo(poFile, ["STR_ARR_SVT_LANGUAGE_TABLE"], translations) - f = open(onlineDir + '/browser/l10n/locore/' + lang + '.json', 'w') + f = open(onlineDir + '/browser/l10n/locore/' + lang + '.json', 'w', encoding='utf-8') f.write('{\n') writeComma = False @@ -115,7 +115,7 @@ if __name__ == "__main__": else: writeComma = True f.write( - ('"' + key + '":"' + translations[key] + '"').encode('utf-8')) + ('"' + key + '":"' + translations[key] + '"')) f.write('\n}\n')