15 lines
424 B
Python
15 lines
424 B
Python
import json
|
|
|
|
models = json.loads(open("translate_models.json").read())
|
|
chosen_model = input("Select model (" + ", ".join(list(models.keys())) + "): ")
|
|
|
|
while True:
|
|
t = input("Enter text here: ")
|
|
|
|
translated_t = t
|
|
for i in models[chosen_model]:
|
|
translated_t = translated_t.replace(i[0], i[1])
|
|
translated_t = translated_t.replace(i[0].upper(), i[1].upper())
|
|
|
|
print(f"Result: {translated_t}\n")
|