Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
movingtarget
Level 7

roLocalization problem

Can someone please explain what's wrong here:


BrightScript Debugger> p loc
<Component: roLocalization>
BrightScript Debugger> p loc.GetPluralString
Syntax Error. (runtime error &h02) in $LIVECOMPILE(8)
BrightScript Debugger> p loc.GetLocalizedAsset
Syntax Error. (runtime error &h02) in $LIVECOMPILE(9)


I'm using roLocalization object which should be supported (http://sdkdocs.roku.com/pages/viewpage. ... Id=3114060), and is in fact created. But the ifLocalization interface appears to not exist. How can I fix this? I'm on 5.5.
0 Kudos
4 Replies
TheEndless
Level 7

Re: roLocalization problem

You're trying to print the results of a method without any parameters or parentheses, which is resulting in a syntax error.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
EnTerr
Level 8

Re: roLocalization problem

Hm, yeah - BrightScript is funky like that. Depending on your language background, you may expect `obj.method` (no params) to either call the method (Ruby?) or to return a bound method function (Python):
>>> f = 'abcdefgh'.find
>>> f
<built-in method find of str object at 0x2b9620>
>>> f('d')
3

But it doesn't - and can't blame it for it, because BRS is a different language. I suspect there was a complication in implementing this, so instead a runtime error is thrown (notice how this is not the usual flavor of "Syntax Error. (compile error &h02)").
0 Kudos
movingtarget
Level 7

Re: roLocalization problem

I was trying to show a sample... But if you insist - this doesn't work either:


BrightScript Debugger> loc = CreateObject("roLocalization")
BrightScript Debugger> p loc
<Component: roLocalization>
BrightScript Debugger> p loc.GetPluralString(2, "1 something", "^n somethings")
Member function not found in BrightScript Component or interface. (runtime error &hf4) in $LIVECOMPILE(9)
0 Kudos
RokuMarkn
Level 7

Re: roLocalization problem

Looks like there was an error in the GetPluralString documentation. It should take 4 parameters. I've corrected it here.

--Mark
0 Kudos