Skip to content

Commit

Permalink
Merge pull request #71304 from BrettDong/translate-widget
Browse files Browse the repository at this point in the history
Extract UI widget clauses text for translation
  • Loading branch information
Maleclypse authored Jan 28, 2024
2 parents f463d8c + c247f08 commit f007c87
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lang/string_extractor/parsers/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ def parse_widget(json, origin):
comment = "Text in portion of UI widget \"{}\"".format(id)
if "text" in phrase:
write_text(phrase["text"], origin, comment=comment)
if "default_clause" in json:
write_text(json["default_clause"]["text"], origin,
comment="Default clause of UI widget \"{}\"".format(id))
if "clauses" in json:
for clause in json["clauses"]:
if "text" not in clause:
continue
write_text(clause["text"], origin,
comment="Clause text \"{}\" of UI widget \"{}\""
.format(clause["id"], id))

0 comments on commit f007c87

Please sign in to comment.