enhancement
major
major
minor
#29804
XML import: line and column of a message location are formatted with a thousands separator ("line 4,433")
The location the XML import adds to a message (I18NLogAsXMLStreamLog.withLocation, keys com.top_logic.basic.xml.log.I18NConstants.AT_LOCATION__FILE_LINE_COL_DETAIL and AT_LOCATION__LINE_COL_DETAIL, texts In {0} line {1} column {2}: {3}) formats line and column as locale numbers, so a line beyond 999 reads "line 4,433" (en) or "Zeile 4.433" (de). TL 8.0.0-alpha10.
Reproduction: E-Home, import src/test/fixtures/TestDynamic.knxproj into a database without its program; the import report shows "In knxproj:M-0008/M-0008_A-10D7-11-A0E5-O000C.xml Zeile 4.433 Spalte 183: …".
Fix: {1,number,#} / {2,number,#} in the texts (and {0,number,#} / {1,number,#} in the variant without file), or pass the numbers as strings.
Lösung
Die Zeilen- und Spaltenargumente der Meldungstexte werden mit dem Unterformat {n,number,#} formatiert (ohne Tausendertrennzeichen), die Java-Aufrufer bleiben unverändert. Das Message-Format von TopLogic (TLMessageFormat) unterstützt die Unterformate von java.text.MessageFormat.
Denselben Fehler haben alle weiteren Meldungen mit Zeilen- und Spaltenangabe; sie werden auf dieselbe Weise korrigiert:
- com.top_logic.basic.xml.log.I18NConstants.AT_LOCATION__FILE_LINE_COL_DETAIL, AT_LOCATION__LINE_COL_DETAIL (basicMessages_en/de.properties)
- com.top_logic.xio.importer.I18NConstants.ERROR_PROBLEM__FILE_LINE_COL_MSG, com.top_logic.xio.importer.handlers.I18NConstants.IMPORT_SPEC__FILE_LINE_COL (tl.xio.messages_en/de.properties, Überschreibung in tl-bpe.messages_en/de.properties)
- die *_ROW_COL*-Schlüssel von com.top_logic.template.I18NConstants (TemplateMessages_en/de.properties). Dabei korrigiert: der deutsche Text von ERROR_TEMPLATE_EXPANSION_FAILED__NAME_ROW_COL_ERROR endete mit {1} (Zeile) statt {3} (Fehler); MISSING_ATTRIBUTE__NAME_ROW_COL nannte weder den Attributnamen noch das Wort "Zeile" ("No such attribute: {1}, column {2}").
Der Unit-Test test.com.top_logic.basic.xml.log.TestI18NLogAsXMLStreamLog prüft über die echten Resource-Bundles, dass eine Position mit Zeile 4433 und Spalte 183 in beiden Sprachen (mit und ohne Datei) ohne Tausendertrennzeichen ausgegeben wird.