Your Digital Media Has Never Looked So Good

 
SoN9ne
Topic Author
Posts: 24
Joined: Thu Apr 24, 2014 1:34 pm

tr() for a paragraph not working

Thu May 01, 2014 11:23 am

Hello,

I currently have:
screen.AddParagraph( tr("The SonLife Broadcasting Network is a Christian multi-media network, which includes Television, Radio and Internet broadcasts. An outreach of Jimmy Swaggart Ministries, this network offers a variety of live and prerecorded programs, specializing in music and teaching, that appeal to audiences of all generations and backgrounds. The line-up is comprised of music, talk-shows, live Church services, studio programs, youth programs, children’s programs and much, much more. Jimmy Swaggart Ministries has not only had an impact in the United States in the last 50 years, but as well, has an international reach that still continues to this day.") )


The problem is this does not translate. I am assuming it's because it's a paragraph and tr() is meant to be used for single sentences. Is there a preferred way to handle paragraph translations?
For now, I am thinking of using a conditional in the code to show the paragraph but worry this will prevent the channel from being approved. Something like:
    locale = getLocale()
    print "Locale is: " ; locale
    if ("es_ES" = locale) then
        paragraph = "SonLife Broadcasting Network es una red multimedia cristiana, que incluye emisiones de televisión, radio e Internet. Un alcance del Ministerio de Jimmy Swaggart, esta red ofrece una variedad de programas en vivo y pregrabados, que se especializa en música y enseñanza, que interesa al público de todas las generaciones y orígenes. La disposición se compone de música, programas de entrevistas, cultos en vivo, programas en el estudio de televisión, programas para jóvenes, programas para niños y mucho más. El Ministerio de Jimmy Swaggart no sólo ha tenido un impacto en los Estados Unidos en los 50 últimos años, sino también, tiene un alcance internacional que aún continúa hasta el día de hoy"
    else
        paragraph = "The SonLife Broadcasting Network is a Christian multi-media network, which includes Television, Radio and Internet broadcasts. An outreach of Jimmy Swaggart Ministries, this network offers a variety of live and prerecorded programs, specializing in music and teaching, that appeal to audiences of all generations and backgrounds. The line-up is comprised of music, talk-shows, live Church services, studio programs, youth programs, children’s programs and much, much more. Jimmy Swaggart Ministries has not only had an impact in the United States in the last 50 years, but as well, has an international reach that still continues to this day."
    end if
    screen.AddParagraph( paragraph )


Any ideas or suggestions?
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: tr() for a paragraph not working

Thu May 01, 2014 1:37 pm

 
SoN9ne
Topic Author
Posts: 24
Joined: Thu Apr 24, 2014 1:34 pm

Re: tr() for a paragraph not working

Thu May 01, 2014 2:04 pm

This is due to this post from the Roku Developer Blog. I am trying to Localize my channel as it is used for English and Spanish. We currently have two separate channels but are making them into one. My issue is that I need to translate a paragraph but it doesn't seem to work.

I'm also wondering if my fix would have any issues with getting the channel approved.
 
User avatar
squirreltown
Posts: 864
Joined: Sun Apr 21, 2013 2:20 pm

Re: tr() for a paragraph not working

Thu May 01, 2014 2:25 pm

Every time I find something not translating it's because I either don't have the source exactly the same in the code & english and spanish XML files or sometimes I blow it and have two targets with the same ID number. The Roku ignores the page designations in the XML files and just goes by the ID's.
It will work with one line of any length, so if your Roku screen is automatically wrapping one long string that should work. (no carriage returns)
Otherwise you do need to make separate translations in between your +chr(10)+'s
Kinetics Screensavers
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: tr() for a paragraph not working

Thu May 01, 2014 2:55 pm

SoN9ne wrote:
This is due to this post from the Roku Developer Blog. I am trying to Localize my channel as it is used for English and Spanish. We currently have two separate channels but are making them into one. My issue is that I need to translate a paragraph but it doesn't seem to work.

I'm also wondering if my fix would have any issues with getting the channel approved.

Oh come on Roku!!! Another undocumented function. :oops:
It's been 1 year and 9 months and this localization stuff has not made it to the SDK! Just because someone wrote a "blog entry" at some point, documentation that does not make. I searched for it, there is no tr() in the wiki.

On your question, SoN9ne: if you roll your own version of localization, that won't cause problem with channel review. The functionality is provided for your convenience but as you see not quite documented/explained. What tr() does apparently is simple lookup in xml directory structure descibed in the blog - it is not supposed to do translate of full paragraphs.
 
User avatar
squirreltown
Posts: 864
Joined: Sun Apr 21, 2013 2:20 pm

Re: tr() for a paragraph not working

Thu May 01, 2014 3:14 pm

EnTerr wrote:
It's been 1 year and 9 months and this localization stuff has not made it to the SDK!


Far be it from me to rain on your rant, But there is a Localization example in the SDK. Now that being said, It is the part of the SDK where you have to go to that certain place and down an alley and around the corner and a little door opens up and you give the correct password ("swordfish") and then you are allowed to download something you though you already had, but don't really.

As far as the Wiki goes - yep - No Habla tr()
Kinetics Screensavers
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: tr() for a paragraph not working

Thu May 01, 2014 3:51 pm

squirreltown wrote:
Far be it from me to rain on your rant, But there is a Localization example in the SDK. Now that being said, It is the part of the SDK where you have to go to that certain place and down an alley and around the corner and a little door opens up and you give the correct password ("swordfish") and then you are allowed to download something you though you already had, but don't really. As far as the Wiki goes - yep - No Habla tr()

If not raining, you are sprinkling at least. But let's look for that example in the SDK:

Developer Guide wrote:
1.2 Developing with the Roku SDK
The Roku SDK consists of a set of documentation, design guidelines, and sample applications that enable channels to be developed for the Roku Streaming Player. To understand the Roku SDK, here are the key documents:

  • The Developer Guide (DeveloperGuide.pdf) covers the architecture, programming language, development process, and channel deployment requirements.
  • The BrightScript Reference Manual will bring you up to speed on the language and serves as a reference for the core components. BrightScript is the programming language used to develop channel applications on the Roku Streaming Player. BrightScript is a scripting language optimized to be the high level glue that ties together BrightScript Components and the Internet.
  • The Component Reference guide describes the Roku Streaming Player platform components that expose APIs to BrightScript.

The entire documentation set includes the following:

Developer Guide Introduction to developing for the Roku platform
BrightScript Reference Manual Reference for the BrightScript programming language.
Component Reference Manual Reference for the components exposed to BrightScript
Channel Packaging and Publishing Creating a package and uploading to the Developer Site
Design Guidelines User Experience guidelines and standard art dimensions
Mockup Tool (PowerPoint) Quickly create a mockup of your channel as ppt screens
Device Registration and Linking Linking the Roku Streaming Player channel to an account on your site
BIF File Specification How to support Trick Mode for your streams
Encoding Guide Creating Roku compatible streams.
Eclipse Plugin for Brightscript Guide Installing and using the "Brightscript IDE".

In addition to the documentation, the SDK includes a set of sample apps that demonstrate some of the BrightScript and Roku Platform programming techniques. You may reuse any of the code found in these sample apps as a basis for your own development, subject to the terms of the Roku Channel Developer Agreement. A brief description of these sample apps follows:

[... List of app links here, nothing about localization ... ]


To sumamrise, SDK consists of (a) documentation and (b) examples. They are all listed in section 1.2 of the developer guide, from which i copied above. There is no localization example there, therefore it is not in the SDK. Everything else (discussions in the forums, StackOverflow, somebody's blog) is non-canonical, i.e. did not made it to "the Bible". And, localization is not the only example that is missing. There are 27 examples listed on the wiki and 40 zips at http://sourceforge.net/projects/rokusdkexamples/files . But don't think the latter is a super-set of the former because some are missing there. To get the examples you need to create "union" between the two, with sprinkles from ye olde SDK ZIPs and dropbox links from the forum. And that likely will be incomplete - but for sure unreliable regarding the latest/working versions.

The way this is dealt with by RokuCo is extremely unprofessional. I get the impression whoever oversees the doco now has never worked in a company where formal documentation is produced. It is unacceptable to use this forum as long-term documentation, to have on SourceForge unmaintained repository of examples (they lack makefiles!) and to "dropbox" patches for the examples that should be included in the SDK

If Roku development is a hobby for you, maybe it does not bother you. I am software engineer however and it pisses the heck out of me. We should strive for a single, reliable source that can be consulted when information is needed, and not do the "secret agent" procedures you described. It does not have to be on paper, does not have to be in PDF, does not have to be in pretty fonts - but it has to be in one place and searchable. Which it is - it is wiki, how much easier can it get maintaining that?!
Last edited by EnTerr on Thu May 01, 2014 10:34 pm, edited 1 time in total.
 
User avatar
squirreltown
Posts: 864
Joined: Sun Apr 21, 2013 2:20 pm

Re: tr() for a paragraph not working

Thu May 01, 2014 6:57 pm

EnTerr wrote:

The way this is dealt with by RokuCo is extremely unprofessional. I get the impression whoever oversees the doco now has never worked in a company where formal documentation is produced. It is unacceptable to use this forum as long-term documentation, to have on SourceForge unmaintained repository of examples (they lack makefiles!) and to "dropbox" patches for the examples that should be included in the SDK

If Roku development is a hobby for you, maybe it does not bother you. I am software engineer however and it pisses the heck out of me. We should strive for a single, reliable source that can be consulted when information is needed, and not do the "secret agent" procedures you described. It does not have to be on paper, does not have to be in PDF, does not have to be in pretty fonts - but it has to be in one place and searchable. Which it is - it is wiki, how much easier can it get maintaining that?!


Well , it's not my profession for sure but it's sure not a hobby. Hobbys are fun. This is a constant challenge, and I'm sure i need good documentation as much as anyone, since i started at literarily zero. I just leave it to experienced people who know better to rant when rants are required.
Kinetics Screensavers
 
SoN9ne
Topic Author
Posts: 24
Joined: Thu Apr 24, 2014 1:34 pm

Re: tr() for a paragraph not working

Fri May 02, 2014 7:09 am

Come on guys, I just started Roku development 2 days ago... You're already scaring me away! lol

Thank you EnTerr for you assistance around the forums. I was just worried my fix for the paragraph translation would prevent it getting approved. It seems that's not the case.

I agree with you about their documentation... I've worked on plenty of systems and, while this is not the worst documentation I have seen, it definitely isn't easy to get the information you need when you are new to Roku development.
 
User avatar
kc8pql
** Valued Community Member **
Posts: 9026
Joined: Fri Jan 23, 2009 3:54 pm
Location: US

Re: tr() for a paragraph not working

Fri May 02, 2014 8:33 am

On the other hand, the cost of the SDK and Roku's charges for publishing a public channel should possibly be kept in mind...
____________________________________________________________________________________________________________
No, I don't work for Roku.
Netflix Player N1000X, XDS 2100X (premature death by lightning)
Roku2 XD 3050X, Roku2 XS 3100R, Roku2 4210R
 
SoN9ne
Topic Author
Posts: 24
Joined: Thu Apr 24, 2014 1:34 pm

Re: tr() for a paragraph not working

Fri May 02, 2014 8:51 am

kc8pql wrote:
On the other hand, the cost of the SDK and Roku's charges for publishing a public channel should possibly be kept in mind...

Not really, considering opensource has better documentation and SDKs than this. Documentation and SDK benefits them more than it does us. (opens doors for more developers to make their network grow) Not to mention their success also depends on third-party developers.

Roku should want to maintain their SDK and documentation as it would really benefit them and the consumer. There is no excuse for this asides from poor management decisions IMHO.
Either way, at least they setup a forum to wishfully compensate for their lack of organization and documentation
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: tr() for a paragraph not working

Mon Apr 04, 2016 1:21 am

Hallelujah - tr() function just got documented!
(it took under 4 years :twisted: )

Who is online

Users browsing this forum: No registered users and 7 guests