Retrieve strings from Kodi if no string is found for PKC
This commit is contained in:
parent
6e6d6cc110
commit
6957b9a522
3 changed files with 7 additions and 6 deletions
|
@ -472,8 +472,8 @@ class SpecialMonitor(Thread):
|
||||||
def run(self):
|
def run(self):
|
||||||
LOG.info("----====# Starting Special Monitor #====----")
|
LOG.info("----====# Starting Special Monitor #====----")
|
||||||
# "Start from beginning", "Play from beginning"
|
# "Start from beginning", "Play from beginning"
|
||||||
strings = (utils.try_encode(xbmc.getLocalizedString(12021)),
|
strings = (utils.try_encode(utils.lang(12021)),
|
||||||
utils.try_encode(xbmc.getLocalizedString(12023)))
|
utils.try_encode(utils.lang(12023)))
|
||||||
while not self.stopped():
|
while not self.stopped():
|
||||||
if xbmc.getCondVisibility('Window.IsVisible(DialogContextMenu.xml)'):
|
if xbmc.getCondVisibility('Window.IsVisible(DialogContextMenu.xml)'):
|
||||||
if xbmc.getInfoLabel('Control.GetLabel(1002)') in strings:
|
if xbmc.getInfoLabel('Control.GetLabel(1002)') in strings:
|
||||||
|
|
|
@ -115,9 +115,12 @@ def settings(setting, value=None):
|
||||||
|
|
||||||
def lang(stringid):
|
def lang(stringid):
|
||||||
"""
|
"""
|
||||||
Central string retrieval from strings.po
|
Central string retrieval from strings.po. If not found within PKC,
|
||||||
|
standard XBMC/Kodi strings are retrieved.
|
||||||
|
Will return unicode
|
||||||
"""
|
"""
|
||||||
return ADDON.getLocalizedString(stringid)
|
return (ADDON.getLocalizedString(stringid) or
|
||||||
|
xbmc.getLocalizedString(stringid))
|
||||||
|
|
||||||
|
|
||||||
def dialog(typus, *args, **kwargs):
|
def dialog(typus, *args, **kwargs):
|
||||||
|
|
|
@ -226,8 +226,6 @@ class VideoNodes(object):
|
||||||
stringid = nodes[node]
|
stringid = nodes[node]
|
||||||
if node != "1":
|
if node != "1":
|
||||||
label = utils.lang(stringid)
|
label = utils.lang(stringid)
|
||||||
if not label:
|
|
||||||
label = xbmc.getLocalizedString(stringid)
|
|
||||||
else:
|
else:
|
||||||
label = stringid
|
label = stringid
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue