Merge pull request #8849 from furo321/fix-twlang-endline

Set correct end line in `twlang.py` for strings with context
This commit is contained in:
Dennis Felsing 2024-08-30 18:44:10 +00:00 committed by GitHub
commit 914867d980
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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]