getLocalizedString unfortunately defaults to XBMC strings!
#1
Exclamation 
Hi, I have a minor problem with a script. I have provided sample code at http://f3ar.bravehost.com/_xbmc/getLocalizedString.rar. The problem occurs when I use xbmc.getLocalizedString(30001), which should be 'f3ar' in this case. The script does not pick the string in myscript/resources/language/English/strings.xml it defaults to the XBMC strings located in XBMC/language/English/strings.xml, which doesn't contain anything. The problem occurs on Xbox and Win32 platforms. Am I missing anything completely obvious?
New: March 25, 2009!
HockeyStreams.com XBMC Script
Reply
#2
You should be using 32000-32999 for scripts, 30000-30999 is for plugins. Scripts and plugins are different, though I'm not real sure if that should matter in this case.
Reply
#3
You have to be using winxml for a start. Otherwise, no way to possibly know how to load the string or which script to associate it with and so on.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
thanks for the quick reply; however, the post does not solve the problem. i tried 32001 and it still prints a blank line when 'f3ar' should be printed.
New: March 25, 2009!
HockeyStreams.com XBMC Script
Reply
#5
jmarshall Wrote:You have to be using winxml for a start. Otherwise, no way to possibly know how to load the string or which script to associate it with and so on.

can you provide a link for winxml? or any information? thank you! Cool
New: March 25, 2009!
HockeyStreams.com XBMC Script
Reply
#6
Find a post by Nuka1195 on these forums, and look in his sig.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
here, but scripts do not require there string id's be in that range.

they do or did require they be no higher than a certain number (can't look now). the amt script has id's up to 2153.

if any scripter on the team wishes to add that to the pydocs, might be good.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#8
you also need to subclass xbmc.Language. which is why you're getting no results

__language__ = xbmc.Language( os.getcwd() ).getLocalizedString

then use __language__( id number )

and i shouldn't correct the developer who coded it Smile, but winxml isn't needed to use this.

i see a special check in the code for scripts 32000-32999. maybe winxml does not require those id's and non winxml scripts do? can't test right now.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#9
a quick look. winxml scripts need string id's less than 4096

non winxml scripts can use any id, but if you use an existing id (skin or xbmc) it overrides it. so best to use id's 32000-32999 as althekiller said.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#10
let me be clearer.

there are two ways to getLocalizeString()'s. one subclassing and two just using xbmc.getLocalizeString().

if you subclass, then you will get the scripts string. if you don't. you will get xbmc or the skins.

nothing get's overridden
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#11
Nuka1195 Wrote:let me be clearer.

there are two ways to getLocalizeString()'s. one subclassing and two just using xbmc.getLocalizeString().

if you subclass, then you will get the scripts string. if you don't. you will get xbmc or the skins.

nothing get's overridden

Thank you Nuka1195, it works now. Cool
I used the subclassing __language__ idea you presented.

To answer this question for others:
Code:
import xbmc, os
__language__ = xbmc.Language( os.getcwd() ).getLocalizedString
print __language__( 32001 )
New: March 25, 2009!
HockeyStreams.com XBMC Script
Reply
#12
Thanks for the clarification Nuka1195!
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#13
How would I change the language? Does it rely on the 'language' system setting? If I have a script with two languages, say English and Russian, and the setting in XBMC is Russian, does the script read the russian strings.xml?
New: March 25, 2009!
HockeyStreams.com XBMC Script
Reply

Logout Mark Read Team Forum Stats Members Help
getLocalizedString unfortunately defaults to XBMC strings!0