SVGHMI: make a copy of tests/svghmi as test/svghmi_widget because too crowded since having pages for widget documentation. Strip those pages from tests/svghmi, so that it
is more light for regular testing.
// i18n.ysl2
template "svg:tspan", mode="extract_i18n" {
if "string-length(.) > 0" line {
value ".";
}
}
template "svg:text", mode="extract_i18n" {
msg {
attrib "id" value "@id";
attrib "label" value "substring(@inkscape:label,2)";
apply "svg:*", mode="extract_i18n";
}
}
const "translatable_texts", "//svg:text[starts-with(@inkscape:label, '_')]";
const "translatable_strings" apply "$translatable_texts", mode="extract_i18n";
emit "preamble:i18n" {
const "translations", "ns:GetTranslations($translatable_strings)";
> var langs = [
foreach "$translations/langs/lang" {
value ".";
if "position()!=last()" > ,
}
| ];
| var translations = [
foreach "$translatable_texts" {
const "n","position()";
> ["«@id»",[
foreach "$translations/messages/msgid[$n]/msg" {
> "
foreach "line" {
value ".";
if "position()!=last()" > \\\\n
}
> "
if "position()!=last()" > ,
}
> ]]
if "position()!=last()" > ,
> \n
}
| ]
}