Kodi Community Forum
settings.xml help="" - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: settings.xml help="" (/showthread.php?tid=352800)



settings.xml help="" - emveepee - 2020-03-24

Is there a way to have settings.xml in Matrix show raw help text which is not yet in strings.po?  It is a nice feature but during development it takes two steps to getting it looking right.

Martin


RE: settings.xml help="" - Montellese - 2020-03-26

Right now there isn't. To convert old-style add-on settings (which support this) to core-style add-on settings there's a workaround for this in CAddonSettings but it's not present for core-style settings. I agree that it can be a bit cumbersome during development but in the end all of your label and help strings must be translatable. If we would allow this "shortcut" it would increase the chance of someone forgetting to replace those strings with translatable labels / IDs.


RE: settings.xml help="" - emveepee - 2020-03-26

Thanks. Is there any style guide  strings.po?   To help with the  conversion what I would like to do is keep me current settings together with the help by adding 10000 to the current label id and put a notice at the end of the file that.   This will mean the ID's aren't ordered and are not sequential.
Code:
msgctxt "#30003"
msgid "Enable TimeShift with Live TV"
msgstr ""

msgctxt "#40003"
msgid "Help for Timeshift"
msgstr ""

msgctxt "#30004"
msgid "Download TV Guide Artwork"
msgstr ""

msgctxt "#40004"
msgid "Warning will currently cause slowdowns in Matrix"
msgstr ""

...
# Note message 40000-49999 are reserved for help

Martin


RE: settings.xml help="" - Montellese - 2020-03-26

I'm no expert on strings.po so I have no idea if the order matters but normally msgctxt can be anything and usually not a number I don't think that order matters. In this case it just makes it easier to avoid using the name number / ID twice.


RE: settings.xml help="" - emveepee - 2020-03-26

Ok thanks I thought it had to be a number based on this comment https://github.com/xbmc/xbmc/blob/master/addons/resource.language.en_gb/resources/strings.po#L16353  I will see what happens if I just append an H and insert them in order with the existing values

Martin


RE: settings.xml help="" - black_eagle - 2020-03-26

AFAIK, the No. in msgctxt is the string ID used by Kodi to localize the language with either $LOCALIZE[string ID] in skins, or g_localizeStrings.Get(string ID) in core.


RE: settings.xml help="" - emveepee - 2020-03-26

I just tried with the H and that didn't work since it gets scanned to the same number.   I will keep them out of order but instead of adding 10000 I will add 500.  I am at 172  now, but that should be ok.

I also noted that if you use a number outside the range 33000 thru 33999 the addon will use the common value

Martin


RE: settings.xml help="" - Montellese - 2020-03-27

Kodi requires it to be a number but in general the gettext PO format doesn't require it to be a number. That's why I reasoned that it doesn't have to be in order.

And yes there's a limited range of available IDs for add-ons.


RE: settings.xml help="" - emveepee - 2020-03-27

This change is pretty far reaching, it is not just help it is every value in the setting.   There does seem to be an issue in the logic since using this example https://kodi.wiki/view/Add-on_settings_conversion#type.3D.22select.22  since there seem to be now no way to give a pick list of numbers without having the numbers in strings.po

Martin


RE: settings.xml help="" - Montellese - 2020-03-27

That example could be covered by using
xml:

<constraints>
  <min>11</min>
  <step>1</step>
  <max>14</max>
</constraints>
but yes the <options> tag only supports translatable labels.


RE: settings.xml help="" - emveepee - 2020-03-27

On a hunch I removed the label and the integer values show up so that solves this issue.

Martin


RE: settings.xml help="" - emveepee - 2020-03-28

If I have the same id in multiple categories or in the same category I end up with user settings.xml with duplicate id's stored.  Is this is the expected behavior? 

If so is there any way to update the same id with different controls with different options (in my case a PVR backend with multiple backends).

Martin