svghmi/i18n.ysl2
branchsvghmi
changeset 3116 6da94ec04325
parent 3112 bd20f9112014
child 3126 f45e413a0f40
equal deleted inserted replaced
3115:77cfbf1aacf0 3116:6da94ec04325
    18 const "translatable_texts", "//svg:text[starts-with(@inkscape:label, '_')]";
    18 const "translatable_texts", "//svg:text[starts-with(@inkscape:label, '_')]";
    19 const "translatable_strings" apply "$translatable_texts", mode="extract_i18n";
    19 const "translatable_strings" apply "$translatable_texts", mode="extract_i18n";
    20 
    20 
    21 emit "preamble:i18n" {
    21 emit "preamble:i18n" {
    22     const "translations", "ns:GetTranslations($translatable_strings)";
    22     const "translations", "ns:GetTranslations($translatable_strings)";
    23     | var translations = {
    23     > var langs = [
    24     foreach "$translations/*" {
    24     foreach "$translations/langs/lang" {
    25     |     "«local-name()»":{
    25         value  ".";
    26         /* TODO */
    26         if "position()!=last()" > ,
    27     |     }`if "position()!=last()" > ,`
       
    28     }
    27     }
    29     | };
    28     | ];
    30     |
    29     | var translations = [
    31 
    30     foreach "$translatable_texts" {
       
    31         const "n","position()";
       
    32     >   ["«@id»",[
       
    33         foreach "$translations/messages/msgid[$n]/msg" {
       
    34             > "
       
    35             foreach "line" {
       
    36                 value ".";
       
    37                 if "position()!=last()" > \\\\n
       
    38             }
       
    39             > "
       
    40             if "position()!=last()" > ,
       
    41         }
       
    42         > ]]
       
    43         if "position()!=last()" > ,
       
    44         > \n
       
    45     }
       
    46     | ]
    32 }
    47 }