Kodi Community Forum

Full Version: getLocalizedString() and plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm translating the Launcher plugin to Swedish. I've added a folder under ..\XBMC\plugins\Programs\Launcher\resources\language called Swedish. In there I placed a copy of the strings.xml found in the corresponding English folder.

When I run the plugin, strings are still in English. Anyone have any idea why? My language is (of course) set to Swedish in XBMC and the strings DO change if I edit the English\strings.xml file, but I guess that's not the recommended way to go...

Help much appreciated!
use right file encoding (utf-8) and test file structure
example opening in internet explorer
Encoding is set to utf-8 in the document header. How do you mean "test folder structure"?

/English/strings.xml
/Swedish/strings.xml

That's how I have it. Anything else I can check?
i mean is all < and > in right place
if you try open file example some internet browser. If structure is incorrect error occurs
i just test launcher and translation, it works right.
I mean you need save file in utf-8 format, not only set in file header
Enable XBMC debug with AdvanceSettings.xml

Run the script, then look for the debug lines in xbmc.log - If its failing to parse the Swedish string xml it will say something like 'failed to parse' and fall back to the english strings.

XML syntax errors and also bad characters can cause it to fail. (ie. & ) For those you'll need to use the allowed replacements .ie [CR] for newline. Not sure where there's a list of these replacement chars, I normally scour existing Strings.xml from other scripts for examples.