Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[addons] Preserve strings which are not string ids in enum lvalues #8271
Sometimes with addon setting spinners some of the values may be untranslatable, e.g. a proper noun or some kind of identifier. Currently it is impossible to mix string ids to be localized and actual strings because the strings are converted to the string "Programs". This is a result of a lookup of the string id 0 as returned by atoi when it can't convert to an integer.
This PR fixes that so that the fallback is to preserve the original string.
The original thread with some more detail is at http://forum.kodi.tv/showthread.php?tid=244607 in case that's better for discussion.
There are no api changes here. It might actually make more sense to change the api to just have values= and have it behave as lvalues= does with this change. That would make it K** material but this is just a fix, because if you try to mix string ids and literal strings in the same spinner using lvalues= you get the string "Programs" for all the literal strings. With this fix it will do nothing instead and leave the literal strings as they are.
It's a problem specific to the spinner settings labelenum and enum.
@LS80 build fails on android: http://jenkins.kodi.tv/job/Android-ARM/8330/console
1 similar comment
I guess this change may be the reason this:
doesn't work anymore (Amazon VOD plugin - settings) in latest KODI nightlies.
Since this commit the selection doesn't jump from "20" to "30", but from "20" to "November", "October", "40", "Oct", "SSW" and other strange language strings.
Any idea? (Tested on Linux and Win32 Nightly)