aboutsummaryrefslogtreecommitdiffhomepage
path: root/libs/knowit/properties
diff options
context:
space:
mode:
Diffstat (limited to 'libs/knowit/properties')
-rw-r--r--libs/knowit/properties/general.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/knowit/properties/general.py b/libs/knowit/properties/general.py
index c522f87fc..701b9adbf 100644
--- a/libs/knowit/properties/general.py
+++ b/libs/knowit/properties/general.py
@@ -81,7 +81,11 @@ class Language(Property[babelfish.Language]):
"""Handle languages."""
try:
if len(value) == 3:
- return babelfish.Language.fromalpha3b(value)
+ try:
+ return babelfish.Language.fromalpha3b(value)
+ except babelfish.Error:
+ # Try alpha3t if alpha3b fails
+ return babelfish.Language.fromalpha3t(value)
return babelfish.Language.fromietf(value)
except (babelfish.Error, ValueError):