Skip to content

Commit

Permalink
style: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
saraburns1 committed May 30, 2024
1 parent 2f50e13 commit 4e1ece9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tutoraspects/translations/translate_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ def translate_var(
"""
if not content or isinstance(content, str):
return []

# if content is a list, run method for each list item
if isinstance(content, list):
strings = []
for item in content:
strings.extend(self.translate_var(item, var_path))
return strings

if isinstance(content, dict):
# if var_path is wild, run method on every value in dict
if var_path[0] == "*":
Expand All @@ -69,7 +69,7 @@ def translate_var(
return strings
# otherwise, run method again 1 level deeper
return self.translate_var(content.get(var_path[0], " "), var_path[1:])

print("Could not translate var_path: ", var_path, content)
return []

Expand Down

0 comments on commit 4e1ece9

Please sign in to comment.