diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/locales/guided_translation.py | 17 | ||||
| -rw-r--r-- | lib/locales/lang.json | 21 | ||||
| -rw-r--r-- | lib/whitelist.ts | 1 |
3 files changed, 1 insertions, 38 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) diff --git a/lib/locales/lang.json b/lib/locales/lang.json deleted file mode 100644 index c4ce80b4..00000000 --- a/lib/locales/lang.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "en": "English", - "es": "Español", - "fr": "Français", - "de": "Deutsch", - "ja": "日本語", - "ru": "Русский", - "pt": "Português", - "zh": "中文", - "fa": "فارسی", - "el": "Ελληνικά", - "ar": "العربية", - "hi": "हिन्दी", - "bn": "বাংলা", - "tr": "Türkçe", - "ko": "한국어", - "it": "Italiano", - "nl": "Nederlands", - "th": "ไทย", - "pl": "Polski" -} diff --git a/lib/whitelist.ts b/lib/whitelist.ts index 07706432..5df18184 100644 --- a/lib/whitelist.ts +++ b/lib/whitelist.ts @@ -21,6 +21,7 @@ export default [ "keys", "language", "linked", + "locked", "locktime", "memoPrompt", "nip5", |
