xbmc.getLocalizedString() doesn't work
#1
Trying to use xbmc.getLocalizedString() in my python script doesn't work. I get a null string returned.

Translation partially works. I can see the values displayed when I access settings.

But, still in settings, switching to another language does not work. I still get the strings from English returned.

Does the .po file need to contain specific header information?

This should work, right?...

Code:
#resources/language/English/strings.po
msgid ""
msgstr ""

msgctxt "#32000"
msgid "Hello"
msgstr ""

#default.py
import xbmc
print xbmc.getLocalizedString(32000)

on Linux/Frodo
Reply
#2
getLocalizedString search string in the locale set in xbmc settings, it's not your plugin to tell to xbmc wich locale to use

to see strings in other languages from your plugin, you must change xbmc locale setting in xmbc -> sytem -> settings
Reply
#3
Thanks, but I'm not telling xbmc which locale to use.

The default language is English. Locale is set to English. I'm providing an English translation. The script doesn't pick up the English translation.
Reply
#4
I believe the xbmc.getLocalizedString() accesses XBMC's strings, not the addon's strings. You need to use the xbmcaddon module - http://mirror.internode.on.net/pub/xbmc/...addon.html
Reply
#5
That sounds right. Thanks.
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc.getLocalizedString() doesn't work0