2013-12-07, 20:51
I've pushed an update to git with improved localization support and, because there seems to be some interest in it, some updates for using the script to provide the main menu, as opposed to just the submenus (though it'll still take a skilled skinner to pull it together!)
For localization, the script now stores the string id rather than the localized string. This means that if the user switches languages, any shortcuts with localized labels will switch language too. If you want to use a localized string in a skin defaults file then use the format "::LOCAL::id" - so for 'Pictures' you could use "::LOCAL::10002", for example.
Now, for using the script to manage the whole menu...
Firstly, there's a new action for your skinsettings.xml file - the script can fill a list within that page with links to choose main menu items([groupname] - mainmenu), and individual links to set shortcuts for each main menu item. Just use
Next, I've added a new group of shortcuts I've termed 'Common' for things users are likely to want on the main menu.
Finally, because menu items are localized whenever possible, it doesn't seem wise to rely on $INFO[lisitem.label] for choosing the [groupname] of shortcuts as has been previously suggested, as it will change between languages, so I've added a new property to the listitems - labelID.
For common main menu items, this will contain a non-localized string (videos, movies, tvshows, livetv, music, musicvideos, pictures, weather, programs, settings). For other localized strings, it will return the string id (e.g. for 'Profiles' the $INFO[listitem.property(labelID)] will be "13200"). For non-localized string, it will return the string minus any spaces.
You can check this property to decide whether to display, for example, a list of recently added movies, and you should also use this labelID for the naming of any default files the skin provides. Finally, the labelID should be used as the [groupname] to list any shortcuts for the menu item.
Edit: I've pushed another update allowing skinners to override actions by providing an overrides.xml file - it could be used to override going to Movie Titles and run Cinema Experience instead, for example. See the readme file included with the script for full details.
Hope all of that's clear. Let me know how you get on!
For localization, the script now stores the string id rather than the localized string. This means that if the user switches languages, any shortcuts with localized labels will switch language too. If you want to use a localized string in a skin defaults file then use the format "::LOCAL::id" - so for 'Pictures' you could use "::LOCAL::10002", for example.
Now, for using the script to manage the whole menu...
Firstly, there's a new action for your skinsettings.xml file - the script can fill a list within that page with links to choose main menu items([groupname] - mainmenu), and individual links to set shortcuts for each main menu item. Just use
Code:
<content>plugin://script.skinshortcuts?type=settings&property=$INFO[Window(10000).Property("skinshortcuts")]</content>
Next, I've added a new group of shortcuts I've termed 'Common' for things users are likely to want on the main menu.
Finally, because menu items are localized whenever possible, it doesn't seem wise to rely on $INFO[lisitem.label] for choosing the [groupname] of shortcuts as has been previously suggested, as it will change between languages, so I've added a new property to the listitems - labelID.
For common main menu items, this will contain a non-localized string (videos, movies, tvshows, livetv, music, musicvideos, pictures, weather, programs, settings). For other localized strings, it will return the string id (e.g. for 'Profiles' the $INFO[listitem.property(labelID)] will be "13200"). For non-localized string, it will return the string minus any spaces.
You can check this property to decide whether to display, for example, a list of recently added movies, and you should also use this labelID for the naming of any default files the skin provides. Finally, the labelID should be used as the [groupname] to list any shortcuts for the menu item.
Edit: I've pushed another update allowing skinners to override actions by providing an overrides.xml file - it could be used to override going to Movie Titles and run Cinema Experience instead, for example. See the readme file included with the script for full details.
Hope all of that's clear. Let me know how you get on!