Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -50,20 +50,20 @@ def translate_text(text, target_lang):
|
|
50 |
translation = translator.translate(text, dest=target_lang)
|
51 |
return translation.text
|
52 |
|
53 |
-
#
|
54 |
-
def
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
|
68 |
client = Groq(
|
69 |
api_key=os.environ['GROQ_API_KEY'],
|
|
|
50 |
translation = translator.translate(text, dest=target_lang)
|
51 |
return translation.text
|
52 |
|
53 |
+
# Function to translate text content
|
54 |
+
def translated_text(text, target_lang):
|
55 |
+
if target_lang == default_language:
|
56 |
+
return text
|
57 |
+
return translate_text(text, get_language_code(target_lang))
|
58 |
+
|
59 |
+
# Function to translate title
|
60 |
+
def translated_title(title, target_lang):
|
61 |
+
if target_lang == default_language:
|
62 |
+
return title
|
63 |
+
return translate_text(title, get_language_code(target_lang))
|
64 |
+
|
65 |
+
# Translate the title
|
66 |
+
st.title(translated_title("Chatbot", language_option))
|
67 |
|
68 |
client = Groq(
|
69 |
api_key=os.environ['GROQ_API_KEY'],
|