diff --git a/scripts/extract-elx/extract-elx.js b/scripts/extract-elx/extract-elx.js index 9ea1354..6242832 100644 --- a/scripts/extract-elx/extract-elx.js +++ b/scripts/extract-elx/extract-elx.js @@ -204,10 +204,6 @@ function getArraySortKey(propertyName, item) { function getArrayItemName(propertyName, item, index, totalCount) { var itemSuffix = null; - if (propertyName === 'translationsTabMapper' && item && typeof item === 'object' && item.order != null) { - itemSuffix = String(item.order); - } - if (propertyName === 'formSchemaData' && item && typeof item === 'object' && item.id != null) { itemSuffix = String(item.id); } @@ -252,6 +248,24 @@ function getArrayItemName(propertyName, item, index, totalCount) { } } + if (propertyName === 'translationsTabMapper' && item && typeof item === 'object' && item.order != null) { + itemSuffix = String(item.order); + } + + if (propertyName === 'validationTypes' && typeof item === 'string') { + const rawOrderValue = extractXmlValueFromSection(item, 'Dati', 'COL0003'); + if (rawOrderValue) { + const sanitized = sanitizeFileName(rawOrderValue); + if (sanitized) { + itemSuffix = sanitized; + } + } + } + + if (propertyName === 'translationsValidationTabMapper' && item && typeof item === 'object' && item.code != null) { + itemSuffix = String(item.code); + } + if (!itemSuffix) { itemSuffix = padIndex(index, totalCount); }