Share settings/translations between add-ons
#1
I maintain a Kodi add-on (Retrospect) that consists of a main Video add-on and a number of related Video add-ons that contain various parsers for (legal) online video streamers, which I ussuall call channel add-ons. For the end-user it all appears as a single Video add-on, and the fact that there actually are multiple add-on is mainly to support updating these channel add-ons independently.

Some of these channel add-ons required some settings to be configurable. Currently I managed to do this:
  • Each channel add-on has a file with Kodi settings.
  • Whenever a channel add-on has been updated, the main video add-on merges all the separate setting files from the channel add-ons with the main video add-on settings.
  • So now the user can actually access all settings, regardless of to what channel they belong, from a single settings screen.

However there is a catch! Because I merge the settings.xml while running the add-on, Kodi very now and then can't access the settings.xml file (concurrency and so). This causes Kodi to think there are no settings for the add-on and deletes the user settings.xml and thus all settings. Not so nice. So I am looking for a creative solution for this, one that is more Kodi-like.

I was thinking of the following scenario: Let each channel add-on have it's own settings.xml. From the main video add-on settings create a list of channel add-ons which run Addon.OpenSettings(id) to open the actual channel settings. This seems OK, however, all settings are multi lingual, so that would require me to have a lot of duplicate translation files. And those translation files are currently larger than the complete set of files in a channel add-on. This is not very ideal. Is there an way of sharing the translation files?

Or does anybody have other suggestions.
Reply
#2
You can (at least with Kodi 16) access the language strings of another addon using something like this:
Code:
<label>$ADDON[script.module.cmpl 30004]</label>

I used to use this to hold extra strings for my skin mods so I didn't have to modify the language files in the original skin. I've never tried using this in the settings.xml file for an addon though, so I'm not sure if it will work or not.
Reply
#3
(2017-01-22, 21:01)pkscout Wrote: You can (at least with Kodi 16) access the language strings of another addon using something like this:
Code:
<label>$ADDON[script.module.cmpl 30004]</label>

I used to use this to hold extra strings for my skin mods so I didn't have to modify the language files in the original skin. I've never tried using this in the settings.xml file for an addon though, so I'm not sure if it will work or not.

Thanks, that is something I can try out and see how it goes.

EDIT: this works! So that would be a way forward.
Reply

Logout Mark Read Team Forum Stats Members Help
Share settings/translations between add-ons0