From 0c5b96384700db5a92ac50ca1af174b343dcdf75 Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Mon, 23 Oct 2023 10:57:19 +0200 Subject: [PATCH] Add lokalise multi reference check to hassfest (#101876) --- script/hassfest/translations.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/hassfest/translations.py b/script/hassfest/translations.py index 22c3e927703..5c6d7b19719 100644 --- a/script/hassfest/translations.py +++ b/script/hassfest/translations.py @@ -532,6 +532,11 @@ def validate_translation_file( # noqa: C901 "translations", f"{reference['source']} contains invalid reference {reference['ref']}: Could not find {key}", ) + elif match := re.match(RE_REFERENCE, search[key]): + integration.add_error( + "translations", + f"Lokalise supports only one level of references: \"{reference['source']}\" should point to directly to \"{match.groups()[0]}\"", + ) def validate(integrations: dict[str, Integration], config: Config) -> None: