Update chatbot/plugins/languages.py
Browse files- chatbot/plugins/languages.py +11 -29
chatbot/plugins/languages.py
CHANGED
@@ -1,29 +1,11 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
"""
|
11 |
-
|
12 |
-
Returns a list of language dictionaries.
|
13 |
-
"""
|
14 |
-
try:
|
15 |
-
with open(LANGUAGES_JSON_PATH, 'r', encoding='utf-8') as file:
|
16 |
-
data = json.load(file)
|
17 |
-
return data.get('languages', [])
|
18 |
-
except FileNotFoundError:
|
19 |
-
print(f"Error: {LANGUAGES_JSON_PATH} not found.")
|
20 |
-
return []
|
21 |
-
except json.JSONDecodeError as e:
|
22 |
-
print(f"Error parsing {LANGUAGES_JSON_PATH}: {e}")
|
23 |
-
return []
|
24 |
-
|
25 |
-
# Load languages at module import
|
26 |
-
LANGUAGES = load_languages()
|
27 |
-
|
28 |
-
# Create a dictionary for quick access (code -> name)
|
29 |
-
LANGUAGE_DICT = {lang['code']: lang['name'] for lang in LANGUAGES}
|
|
|
1 |
+
LANGUAGES = {
|
2 |
+
"en": "English",
|
3 |
+
"id": "Indonesian",
|
4 |
+
"es": "Spanish",
|
5 |
+
"fr": "French",
|
6 |
+
"de": "German",
|
7 |
+
"jp": "Japanese",
|
8 |
+
"hi": "Hindi",
|
9 |
+
"ru": "Russian",
|
10 |
+
"mg": "Malaygs",
|
11 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|