From bcd1145b9461cacc537668e20c2d87c7ca522c3b Mon Sep 17 00:00:00 2001 From: Binrui Dong Date: Mon, 5 Feb 2024 22:55:31 +0800 Subject: [PATCH] Fix error in extracting translatable strings from body_part (#71519) --- lang/string_extractor/parsers/body_part.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lang/string_extractor/parsers/body_part.py b/lang/string_extractor/parsers/body_part.py index 79b594719ebc6..8d768a9eef384 100644 --- a/lang/string_extractor/parsers/body_part.py +++ b/lang/string_extractor/parsers/body_part.py @@ -19,8 +19,9 @@ def parse_body_part(json, origin): write_text(json["accusative_multiple"], origin, comment="Accusative name of body part") - write_text(json["encumbrance_text"], origin, - comment="Encumbrance text of body part \"{}\"".format(name)) + if "encumbrance_text" in json: + write_text(json["encumbrance_text"], origin, + comment="Encumbrance text of body part \"{}\"".format(name)) write_text(json["heading"], origin, comment="Heading of body part \"{}\"".format(name))