From 71733fe72e8a977b97f027303e13aeaf43d73651 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Fri, 9 Feb 2024 15:54:42 +1100 Subject: [PATCH] fix up for translations --- _validate/createJson.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/_validate/createJson.py b/_validate/createJson.py index 91f29a1..d9b9f50 100644 --- a/_validate/createJson.py +++ b/_validate/createJson.py @@ -124,13 +124,17 @@ def _createDictMatchingJsonSchema( addonData["translations"] = [] for langCode, manifest in getAddonManifestLocalizations(manifest): - addonData["translations"].append( - { - "language": langCode, - "displayName": manifest["summary"], - "description": manifest["description"], - } - ) + try: + addonData["translations"].append( + { + "language": langCode, + "displayName": manifest["summary"], + "description": manifest["description"], + } + ) + except KeyError as e: + manifest._errors = f"Translation for {langCode} missing required key '{e.args[0]}'." + raise return addonData