svghmi/widget_list.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Sun, 14 Feb 2021 19:15:20 +0100
branchsvghmi
changeset 3142 2637bb6a6bb0
parent 3031 440d74319a74
child 3175 b2ba6eeb61ec
permissions -rw-r--r--
SVGHMI: allow i18n of formated strings of HMI:Messages. This was by construction impossible since formating was given as an argument. Now added optional "format" labelled element in HMI:Display, so that it can be translated, when labelled "_format".
// widget_list.ysl2

template "widget[@type='List']", mode="widget_defs" {
    param "hmi_element";
    |     items: {
    foreach "$hmi_element/*[@inkscape:label]" {
    |         «@inkscape:label»: "«@id»",
    }
    |     },
}

template "widget[@type='TextStyleList']", mode="widget_defs" {
    param "hmi_element";
    |     styles: {
    foreach "$hmi_element/*[@inkscape:label]" {
        const "style", "func:refered_elements(.)[self::svg:text]/@style";
    |         «@inkscape:label»: "«$style»",
    }
    |     },
}