From 51f8df1ddfd8be1bbc96fc346da57f8cb26cd7ce Mon Sep 17 00:00:00 2001 From: David Benepe Date: Sat, 5 Feb 2022 15:15:54 -0500 Subject: [PATCH] Moved the naming dict to a JSON file --- tools/python/fix_regional_names.py | 9 ++++----- tools/python/regional_names.json | 5 +++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 tools/python/regional_names.json diff --git a/tools/python/fix_regional_names.py b/tools/python/fix_regional_names.py index 430f773c..fa1ed295 100755 --- a/tools/python/fix_regional_names.py +++ b/tools/python/fix_regional_names.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import argparse +import json import re import os @@ -14,12 +15,10 @@ TERMINAL_COLOR_GREEN = "\033[32m" TERMINAL_COLOR_YELLOW = "\033[33m" TERMINAL_COLOR_RESET = "\033[0m" +REGIONAL_NAMES_JSON_PATH = 'tools/python/regional_names.json' + # Note: All names MUST be lowercase -diffMap = [ - { "us": "color", "uk": "colour" }, - { "us": "gray", "uk": "grey" }, - { "us": "dialog", "uk": "dialogue" }, -] +diffMap = json.loads(FileUtil.readAllText(REGIONAL_NAMES_JSON_PATH)) def precheckForErrors(version): versionBuildPath = 'build/' + version diff --git a/tools/python/regional_names.json b/tools/python/regional_names.json new file mode 100644 index 00000000..f4320b2d --- /dev/null +++ b/tools/python/regional_names.json @@ -0,0 +1,5 @@ +[ + { "us": "color", "uk": "colour" }, + { "us": "gray", "uk": "grey" }, + { "us": "dialog", "uk": "dialogue" } +]