Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,13 +19,13 @@ except langcodes.LanguageTagError as e:
|
|
19 |
|
20 |
|
21 |
|
22 |
-
|
23 |
-
try:
|
24 |
-
|
25 |
-
|
26 |
-
except LookupError as e:
|
27 |
-
|
28 |
-
|
29 |
|
30 |
|
31 |
#st.write(f"langcodes found the following tag: {type(found)}") # a Language object
|
|
|
19 |
|
20 |
|
21 |
|
22 |
+
if lang is None:
|
23 |
+
try:
|
24 |
+
found = langcodes.find(langtext)
|
25 |
+
lang = found
|
26 |
+
except LookupError as e:
|
27 |
+
st.write(f"Couldn't look up langtext, sorry: {e}")
|
28 |
+
lang = None
|
29 |
|
30 |
|
31 |
#st.write(f"langcodes found the following tag: {type(found)}") # a Language object
|