1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

feat(vrtManager): the libvirt layer's messages show in the reader's language

vrtManager's errors (some 140: a disk that does not move, a network
address outside its subnet, a host device given to another VM, the
disks a migration cannot copy) were English f-strings, so no catalog
could translate them, on pages or in jobs.

They are marked texts with their values now; a variant that differs by
a word (internal or external, running or persistent, with a subnet or
without) is a whole message of its own, and a list of problems is a
list of messages. OperationError reads in the active language, so the
pages that show one translate it as they are; its args stay English, and
so do the logs and the audit log. Host device problems and the Migrate
tab's reasons a disk is not copied are messages too.
This commit is contained in:
catborise 2026-11-03 00:05:34 +03:00
parent b999a3e286
commit 82b97f8ec5
21 changed files with 2371 additions and 420 deletions

View file

@ -48,11 +48,11 @@ class TestXmlSafety(unittest.TestCase):
wn.wvm = MagicMock()
# Invalid direction
with self.assertRaises(ValueError):
with self.assertRaises(util.OperationError):
wn.set_qos("lateral", 100, 200, 300)
# Invalid numeric strings
with self.assertRaises(ValueError):
with self.assertRaises(util.OperationError):
wn.set_qos("inbound", "not_a_number", 200, 300)
def test_snapshot_xml_payload_is_escaped(self):