import xbmc
from pulsar.addon import ADDON_NAME, ADDON


def notify(message='', header=None, time=5000, image=''):
    if header is None:
        header = ADDON_NAME
    return xbmc.executebuiltin('Notification("%s", "%s", "%d", "%s")' %
                               (header, message, time, image))

def GetLocalizedString(label):
    try:
        return ADDON.getLocalizedString(int(label[9:-1])).encode('utf-8')
    except:
        return label
