2021-09-01, 16:17
Hi,
I used the 'script.settings-convert' in order to convert to the new format.
But there is a problem with multiple selection when all the values options were numbers.
It takes the number value and put it automatically also as a label value,
But the number label value is translated to general string from kodi or something (Like categoires, days names etc.)
"0" = "View: Icons", "1" = "Pictures", "2" - "Music", ...
* This automatic behavior is good when the options are strings/text, but when they are numbers it's not good.
Old settings.xml: https://paste.ubuntu.com/p/FbC7tpDtyV
New settings.xml: https://paste.ubuntu.com/p/G5DRM9h4Xj
Focus on:
On the old it's like this (One of them for example)
On the new:
Sometimes the options are numbers but represnt labels from languages files (using lvalues):
In this case the labels are equal to the values and the options converted to numbers.
This was converted correctly:
So the problem is with the "option's label" tags, it show some irrelevant strings,
while it should shows numbers as an options (Like the values in the old one),
These labels are not needed here when the values are numbers that are not exist in the strings.po
How can I show the values as labels automatically as it was?
Am I must adding it now to the strings.po and replace all the numbers values to string.po labels IDs using lvalues before running the convertor?
(31000 = 0, 31001 = 1, ....)
I used the 'script.settings-convert' in order to convert to the new format.
But there is a problem with multiple selection when all the values options were numbers.
It takes the number value and put it automatically also as a label value,
But the number label value is translated to general string from kodi or something (Like categoires, days names etc.)
"0" = "View: Icons", "1" = "Pictures", "2" - "Music", ...
* This automatic behavior is good when the options are strings/text, but when they are numbers it's not good.
Old settings.xml: https://paste.ubuntu.com/p/FbC7tpDtyV
New settings.xml: https://paste.ubuntu.com/p/G5DRM9h4Xj
Focus on:
xml:<category id="טלויזיה" label="30600" help="">
<group id="1" label="30601">
On the old it's like this (One of them for example)
xml:<setting id="ch_11" type="labelenum" label="30602" values="0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|19|20|100" default="1" />
On the new:
xml:<setting id="ch_11" type="string" label="30602" help="">
<level>0</level>
<default>1</default>
<constraints>
<options>
<option label="0">0</option>
<option label="1">1</option>
<option label="2">2</option>
<option label="3">3</option>
<option label="4">4</option>
<option label="5">5</option>
<option label="6">6</option>
<option label="7">7</option>
<option label="8">8</option>
<option label="9">9</option>
<option label="10">10</option>
<option label="11">11</option>
<option label="12">12</option>
<option label="13">13</option>
<option label="14">14</option>
<option label="15">15</option>
<option label="16">16</option>
<option label="17">17</option>
<option label="19">19</option>
<option label="20">20</option>
<option label="100">100</option>
</options>
</constraints>
<control type="spinner" format="string"/>
</setting>
Sometimes the options are numbers but represnt labels from languages files (using lvalues):
In this case the labels are equal to the values and the options converted to numbers.
xml:<category label="30200">
<setting id="reshetSortBy" type="enum" label="30001" lvalues="30002|30003" default="0" />
<setting id="reshet_res" type="text" label="30023" default="" />
</category>
This was converted correctly:
xml:<category id="רשת" label="30200" help="">
<group id="1">
<setting id="reshetSortBy" type="integer" label="30001" help="">
<level>0</level>
<default>0</default>
<constraints>
<options>
<option label="30002">0</option>
<option label="30003">1</option>
</options>
</constraints>
<control type="spinner" format="string"/>
</setting>
<setting id="reshet_res" type="string" label="30023" help="">
<level>0</level>
<default/>
<constraints>
<allowempty>true</allowempty>
</constraints>
<control type="edit" format="string">
<heading>30023</heading>
</control>
</setting>
</group>
</category>
So the problem is with the "option's label" tags, it show some irrelevant strings,
while it should shows numbers as an options (Like the values in the old one),
These labels are not needed here when the values are numbers that are not exist in the strings.po
How can I show the values as labels automatically as it was?
Am I must adding it now to the strings.po and replace all the numbers values to string.po labels IDs using lvalues before running the convertor?
(31000 = 0, 31001 = 1, ....)