2013-09-14, 18:33
I create in resources\language two folder, "English" and "Italian"
In both, I created strings.xml file
This is english file
The plugin code include this:
Now ... I see the API doc
I understand that I can get a localized string in this way
BUT ... how / where can I set the current language ?
I'm missing somethings like
---
In both, I created strings.xml file
This is english file
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
<string id="30001">Go to page</string>
<string id="30002">Language</string>
<string id="30003">Italian</string>
<string id="30004">English</string>
<string id="30005">General</string>
</strings>
The plugin code include this:
Code:
pluginPid = int(sys.argv[1])
language = xbmcplugin.getSetting(pluginPid, "language")
if language == "":
language = "English"
Now ... I see the API doc
Code:
getLocalizedString(...)
getLocalizedString(id) -- Returns an addon's localized 'unicode string'.
id : integer - id# for string you want to localize.
*Note, You can use the above as keywords for arguments.
example:
- locstr = self.Addon.getLocalizedString(id=6)
I understand that I can get a localized string in this way
Code:
string = plugin.getLocalizedString(30001)
BUT ... how / where can I set the current language ?
I'm missing somethings like
Code:
plugin.setLocale("English")
---