From d40cc86bfa74b0198018fb1bf09f61ded93bcbbd Mon Sep 17 00:00:00 2001 From: furo Date: Fri, 30 Aug 2024 20:15:26 +0200 Subject: [PATCH] Set correct end line in `twlang.py` for strings with context --- scripts/languages/twlang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/languages/twlang.py b/scripts/languages/twlang.py index eba1c9116..28b3fe1d5 100644 --- a/scripts/languages/twlang.py +++ b/scripts/languages/twlang.py @@ -37,7 +37,7 @@ def decode(fileobj, elements_per_key): if current_key: if len(data[current_key]) != 1+elements_per_key: raise LanguageDecodeError("Wrong number of elements per key", fileobj.name, index) - data[current_key].append(index) + data[current_key].append(index - 1 if current_context else index) if line in data: raise LanguageDecodeError("Key defined multiple times: " + line, fileobj.name, index) data[(line, current_context)] = [index - 1 if current_context else index]