Skip to content

Industry leading face manipulation platform

Allow deep nested wording

henryruhs5ebefb6831b8
diff --git a/facefusion/types.py b/facefusion/types.py
index 7057b5d5..141c7673 100755
--- a/facefusion/types.py
+++ b/facefusion/types.py
@@ -355,4 +355,3 @@ State = TypedDict('State',
})
StateSet : TypeAlias = Dict[AppContext, State]
-Wording : TypeAlias = Union[str, Dict[str, str]]
diff --git a/facefusion/wording.py b/facefusion/wording.py
index 14d92160..5c3ef2ba 100755
--- a/facefusion/wording.py
+++ b/facefusion/wording.py
@@ -1,7 +1,5 @@
from typing import Any, Dict, Optional
-from facefusion.types import Wording
-
WORDING : Dict[str, Any] =\
{
'conda_not_activated': 'Conda is not activated',
@@ -343,13 +341,13 @@ WORDING : Dict[str, Any] =\
}
-def get(notation : str) -> Optional[Wording]:
- wording = WORDING
+def get(notation : str) -> Optional[str]:
+ current = WORDING
for fragment in notation.split('.'):
- if fragment in wording:
- wording = wording.get(fragment)
- else:
- return None
+ if fragment in current:
+ current = current.get(fragment)
+ if isinstance(current, str):
+ return current
- return wording
+ return None