# Description: This script is used to patch missing translations in a locale file.
# The script by default uses 'en.json' as the reference file to find missing keys in other locale files. You could point other reference file by passing the file path as the first argument.
# It iterates through each field and their entries in reference locale and checks if the same field/entry exists in other files.
# If a field/entry is missing, the script prompts the source string, reference Google translation, and asks for confirmation or correction.
# The resulting file is saved as './*.proposed.json', and you should review it before merging and uploading.
print(f"\033[91m Total missing keys: \033[0m {len(missing_keys)}")
# now compare the tgt_flat with ref_flat to find all missing keys and prompt to terminal for translation. Then save back to the tgt_flat
# iterate over the missing key and their corresponding values in ref_flat, to get reference google translation using google_translate_to_chinese function
# then present the reference translation to the user in the terminal
# then present the user with a prompt to ask for translation