Update app.py
Browse files
app.py
CHANGED
@@ -22,11 +22,11 @@ def get_FLORES_code_from_language(language):
|
|
22 |
|
23 |
|
24 |
def translate_text(text, destination_language):
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
return translation[0]["translation_text"]
|
31 |
|
32 |
gr.close_all()
|
|
|
22 |
|
23 |
|
24 |
def translate_text(text, destination_language):
|
25 |
+
# text = "Hello Friends, How are you?"
|
26 |
+
dest_code= get_FLORES_code_from_language(destination_language)
|
27 |
+
translation = text_translator(text,
|
28 |
+
src_lang="eng_Latn",
|
29 |
+
tgt_lang=dest_code)
|
30 |
return translation[0]["translation_text"]
|
31 |
|
32 |
gr.close_all()
|