Skip to content

Commit

Permalink
storage: fix parsing blank unit id
Browse files Browse the repository at this point in the history
This is a regression in 2a9c325.
  • Loading branch information
nijel committed Dec 13, 2023
1 parent 2a9c325 commit 701278e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/translate/storage/test_jsonl10n.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ def test_add_other(self):
("[test]selection", [("key", "[test]selection")]),
("[test][0]selection", [("key", "[test][0]selection")]),
("[0][test]selection", [("index", 0), ("key", "[test]selection")]),
("", [("key", "")]),
],
)
def test_from_string(self, id_string, expected):
Expand Down
2 changes: 2 additions & 0 deletions translate/storage/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,8 @@ def from_string(cls, text):
item = item[endbracepos + 1 :]
if item:
result.append(("key", item))
if not result:
result.append(("key", ""))
return cls(result)

def __eq__(self, other):
Expand Down

0 comments on commit 701278e

Please sign in to comment.