summaryrefslogtreecommitdiff
path: root/scripts/code_tools/modified_strings.py
diff options
context:
space:
mode:
authorEuclid Linden <euclid@lindenlab.com>2022-04-18 21:56:26 +0000
committerEuclid Linden <euclid@lindenlab.com>2022-04-18 21:56:26 +0000
commite71201ac125cab5f3d3cf7d6a30500253fc29d90 (patch)
tree270e46eb85dd46fb6962a36a9357dbf31c3afb29 /scripts/code_tools/modified_strings.py
parent2d63d2044e0a00d1969c3da254e016a6e520c0d5 (diff)
parent035b1996df3f357b5060e3eb778588da5b9e7b37 (diff)
Merged in DV528-merge-6.5.5 (pull request #945)
DRTVWR-528 merge up to 6.5.5
Diffstat (limited to 'scripts/code_tools/modified_strings.py')
-rw-r--r--scripts/code_tools/modified_strings.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/code_tools/modified_strings.py b/scripts/code_tools/modified_strings.py
index 6a763b6ec5..e7a9d239dc 100644
--- a/scripts/code_tools/modified_strings.py
+++ b/scripts/code_tools/modified_strings.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""\
This script scans the SL codebase for translation-related strings.
@@ -25,7 +25,7 @@ Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
$/LicenseInfo$
"""
-from __future__ import print_function
+
import xml.etree.ElementTree as ET
import argparse
@@ -75,10 +75,10 @@ translate_attribs = [
]
def codify_for_print(val):
- if isinstance(val, unicode):
+ if isinstance(val, str):
return val.encode("utf-8")
else:
- return unicode(val, 'utf-8').encode("utf-8")
+ return str(val, 'utf-8').encode("utf-8")
# Returns a dict of { name => xml_node }
def read_xml_elements(blob):
@@ -186,7 +186,7 @@ def make_translation_table(mod_tree, base_tree, lang, args):
transl_dict = read_xml_elements(transl_blob)
rows = 0
- for name in mod_dict.keys():
+ for name in list(mod_dict.keys()):
if not name in base_dict or mod_dict[name].text != base_dict[name].text or (args.missing and not name in transl_dict):
elt = mod_dict[name]
val = elt.text
@@ -307,7 +307,7 @@ def save_translation_file(per_lang_data, aux_data, outfile):
print("Added", num_translations, "rows for language", lang)
# Reference info, not for translation
- for aux, data in aux_data.items():
+ for aux, data in list(aux_data.items()):
df = pd.DataFrame(data, columns = ["Key", "Value"])
df.to_excel(writer, index=False, sheet_name=aux)
worksheet = writer.sheets[aux]