diff options
| author | Adam Soltys <[email protected]> | 2025-05-12 12:36:28 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-05-12 12:36:28 -0700 |
| commit | f85ae08db1dd6471d9e2d5edc28025684d0f3af4 (patch) | |
| tree | 74bce0b17195b8bda4973e6a203215b1a87cf364 /lib/locales/guided_translation.py | |
| parent | 67f9ec53b7348860ab55e49574a81df4706dfb06 (diff) | |
| download | coinos-server-f85ae08db1dd6471d9e2d5edc28025684d0f3af4.tar.gz coinos-server-f85ae08db1dd6471d9e2d5edc28025684d0f3af4.zip | |
locked balance
Diffstat (limited to 'lib/locales/guided_translation.py')
| -rw-r--r-- | lib/locales/guided_translation.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/lib/locales/guided_translation.py b/lib/locales/guided_translation.py index 15c5629b..a2f10177 100644 --- a/lib/locales/guided_translation.py +++ b/lib/locales/guided_translation.py @@ -4,7 +4,6 @@ import argparse, json, logging, sys, requests, os from pathlib import Path DEFAULT_FROM_LOCALE = 'en' -LOCALE_DATA_FILEPATH = 'lang.json' def nested_dict_keys(d, _keyname_prefix=''): entry_list = [] @@ -16,18 +15,6 @@ def nested_dict_keys(d, _keyname_prefix=''): entry_list += [_keyname_prefix + key] return entry_list -def create_locale(locale_code): - logging.debug("Creating locale %s...", locale_code) - with open(LOCALE_DATA_FILEPATH, 'r', encoding='utf-8') as lang_file: - lang_data = json.load(lang_file) - - lang_data[locale_code] = input("What is the name of the language " + locale_code + "? ") - - with open(LOCALE_DATA_FILEPATH, 'w') as lang_file: - json.dump(lang_data, lang_file, ensure_ascii=False, indent='\t') - lang_file.write('\n') - logging.debug("Created locale %s.", locale_code) - def localize_string(string_id, from_data, to_data, to_locale): api_key = os.environ.get('GOOGLE_API_KEY') logging.debug("Translating string with id %s", string_id) @@ -125,10 +112,6 @@ if __name__ == "__main__": to_json_text = to_file.read() logging.debug("Converting to data from JSON to object") to_data = json.loads(to_json_text) - else: - logging.info("No file found. Creating new locale.") - create_locale(to_locale) - to_data = {} to_id_list = nested_dict_keys(to_data) logging.info("Successfully obtained %d strings from locale %s", len(to_id_list), to_locale) |
