Solved Formating menu text
#1
Hi,

I need some help with formating text.

In my old addon it was written like this:
json:
AddDir("[COLOR yellow][b]{0}[/b][/COLOR]".format(getLocaleString(30001)), "newList" , 20, os.path.join(iconsDir, "NewList.ico"), isFolder=False)

The color is good but the problem is with the bold tags, it shows it like this:
How can I fix this? in Kodi 17.6 it was ok.
Thanks.
Image
Reply
#2
I found the problem, it was because the encoding issue in the getLocaleString function

Code:
def getLocaleString(id):
    return Addon.getLocalizedString(id).encode('utf-8')

After remove the .encode('utf-8'), it's ok now

Code:
def getLocaleString(id):
    return Addon.getLocalizedString(id)
Reply

Logout Mark Read Team Forum Stats Members Help
Formating menu text0