Allow deep nested wording
This commit is contained in:
@@ -342,10 +342,12 @@ WORDING : Dict[str, Any] =\
|
||||
|
||||
|
||||
def get(key: str) -> Optional[str]:
|
||||
if '.' in key:
|
||||
section, name = key.split('.')
|
||||
if section in WORDING and name in WORDING.get(section):
|
||||
return WORDING.get(section).get(name)
|
||||
if key in WORDING:
|
||||
return WORDING.get(key)
|
||||
current = WORDING
|
||||
|
||||
for fragment in key.split('.'):
|
||||
if fragment in current:
|
||||
current = current.get(fragment)
|
||||
else:
|
||||
return None
|
||||
|
||||
return current
|
||||
|
||||
Reference in New Issue
Block a user