Your Digital Media Has Never Looked So Good

 
savasdenli
Topic Author
Posts: 4
Joined: Wed Mar 28, 2018 8:53 am

Right-to-left (RTL) Languages Support

Wed Mar 28, 2018 9:04 am

Hi everyone. Now i am developing a Roku Channel with Arabic Language. Is there anyway of use Arabic language?

For now i'm using a StringReverse function to convert from ltr to rtl. And using an arabic font for letters shown correctly. It texts are not shown correctly.
For example "Comedy" must be shown as "كوميديا"
But it is shown like that "ك وم ي د يا" Without spaces but shown letter by letter inspite of words (In arabic when letters become to words they must be adjacent).
Note: In Youtube application there isn't this problem. Arabic words are shown correctly.

Thanks a lot.
 
User avatar
24i
Posts: 37
Joined: Wed Feb 15, 2017 7:22 am

Re: Right-to-left (RTL) Languages Support

Mon Apr 09, 2018 5:08 am

Hi savasdenli,

Do you have any luck on solving this?
We are currently developing an application that has to support Arabic languages and we are facing the same problem now.
What do you do in the StringReverse function, as I take it it's something you created yourself?
 
savasdenli
Topic Author
Posts: 4
Joined: Wed Mar 28, 2018 8:53 am

Re: Right-to-left (RTL) Languages Support

Wed Apr 11, 2018 5:18 am

24i wrote:
Hi savasdenli,

Do you have any luck on solving this?
We are currently developing an application that has to support Arabic languages and we are facing the same problem now.
What do you do in the StringReverse function, as I take it it's something you created yourself?

I used this function but it is not enough. 
function stringReverse(input as String) as String
   newStr = ""
   len = len(input)

   for i = len to 1 step -1
      newStr = newStr + mid(input, i, 1)
   end for

   return newStr
end function
 
User avatar
24i
Posts: 37
Joined: Wed Feb 15, 2017 7:22 am

Re: Right-to-left (RTL) Languages Support

Fri Apr 13, 2018 7:33 am

Ah I see, thanks anyway!
We made contact with Roku about this problem, they are looking into the problem with the engineering team. 
Let's hope they can give us something to work with.
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: Right-to-left (RTL) Languages Support

Fri Apr 13, 2018 2:31 pm

Without seeing the actual test display, source text and resulting full text, I can simply suggest - assuming that there is a space between each letter and two or three spaces between words now in the resulting produced output -
A) run your routine as you have it now
B) take the resulting returned string of arabic text and replace two or three consecutive spaces into an unused or uncommon character like *
C) take the result of that operation and replace single spaces with nothing -- ie replace " " with ""
D) take the result of that operation and replace your uncommon substituted character with a single space.

It's a little more work, but if Roku fixes the original problem then you can remove this adjustment, and if they don't then you are good to go.

If it is a display problem, you can check the length of the resulting string and compare it to the length of the source string.
Print LEN(sourcetext)

And for scenegraph, if the string lengths are the same you could put each character into it's own label field for display, and line up the labels with pixel accuracy for display overlapping them if needed to remove the gaps as required for manual display.

Does the source string display with spaces between letters before you reverse the character order?
 
rftvaa
Posts: 7
Joined: Mon Nov 06, 2017 2:45 am

Re: Right-to-left (RTL) Languages Support

Mon Apr 16, 2018 3:44 am

We gave up on the RTL support because we also went with the StringReverse alternative but it became a huge challenge when we had to support multiline labels. In case that is also a requirement in your channel, you should start considering how are you going to support it as soon as possible. I can share our attempts on that later if you need.
 
savasdenli
Topic Author
Posts: 4
Joined: Wed Mar 28, 2018 8:53 am

Re: Right-to-left (RTL) Languages Support

Wed Apr 18, 2018 2:43 am

destruk wrote:
Without seeing the actual test display, source text and resulting full text, I can simply suggest - assuming that there is a space between each letter and two or three spaces between words now in the resulting produced output -
A) run your routine as you have it now
B) take the resulting returned string of arabic text and replace two or three consecutive spaces into an unused or uncommon character like *
C) take the result of that operation and replace single spaces with nothing -- ie replace " " with ""
D) take the result of that operation and replace your uncommon substituted character with a single space.

It's a little more work, but if Roku fixes the original problem then you can remove this adjustment, and if they don't then you are good to go.

If it is a display problem, you can check the length of the resulting string and compare it to the length of the source string.
Print LEN(sourcetext)

And for scenegraph, if the string lengths are the same you could put each character into it's own label field for display, and line up the labels with pixel accuracy for display overlapping them if needed to remove the gaps as required for manual display.

Does the source string display with spaces between letters before you reverse the character order?

Thanks for your reply but the problem is not about spaces. If you look the letters in word "كو " when two letters written without spaces the form of letters must be change like this.

"ك و " if you remove space between this two letter it must be like that  "كو ". In browser it has been automatically. But in roku it doesn't became.

I want to help about this. Only in Youtube Channel this problem has not been occured and shown correctly.
 
User avatar
24i
Posts: 37
Joined: Wed Feb 15, 2017 7:22 am

Re: Right-to-left (RTL) Languages Support

Tue Apr 24, 2018 3:12 am

We gave up on RTL support as well (for now at least). 
We had contact with Roku about this and currently those language are not supported and won't be supported in the near future. 
As savasdenli said, it's not just about the spaces. Other problems you run into is having a keyboard that supports the characters, inputfields and subtitles to which you can't set a different font, rows not starting on the right, etc.
 
User avatar
govinds
Posts: 5
Joined: Wed May 02, 2018 11:53 pm

Re: Right-to-left (RTL) Languages Support

Thu Mar 21, 2019 5:43 am

rftvaa wrote:
We gave up on the RTL support because we also went with the StringReverse alternative but it became a huge challenge when we had to support multiline labels. In case that is also a requirement in your channel, you should start considering how are you going to support it as soon as possible. I can share our attempts on that later if you need.


could you share what you did to solve this? Trying to support RTL on Roku for mutiline labels is becoming so frustrating. Anybody got any good solutions for this?
 
User avatar
speechles
Posts: 169
Joined: Thu Aug 06, 2015 11:15 pm

Re: Right-to-left (RTL) Languages Support

Mon Apr 22, 2019 8:37 pm

govinds wrote:
rftvaa wrote:
We gave up on the RTL support because we also went with the StringReverse alternative but it became a huge challenge when we had to support multiline labels. In case that is also a requirement in your channel, you should start considering how are you going to support it as soon as possible. I can share our attempts on that later if you need.


could you share what you did to solve this? Trying to support RTL on Roku for mutiline labels is becoming so frustrating. Anybody got any good solutions for this?

You said "good solution" so maybe this isn't that. "A solution" is to assume how many characters will fit a label regardless of screen real estate. Then assign 10 labels. Each of those labels number 1 through 10. Now each of those in itself is its own label its own line. You no longer do multi-line as you must now do this in a function using each of your 10 labels or however many you need do span lines onto. You may not need all 10 of these labels for your lines. They are there if you do. You would also have to deal with handling translation placements if this wasn't within say a layout group.

Lets assume it is bound by a layout group that would handle align all the labels and eliminate needing any translation placements in the labels at all and still keep everything lined up nicely. You would probably need to write this as a component that extends the label node. Then use it to create a fake multi-line label using multiple labels. You reference it back by the layout group which would include the child nodes of the labels. Doing the math for all this to figure the right amount of characters to assume for the width of your labels would take some magic math equation. You might be able to use GetOneLineWidth() to more accurately tell when to chop the lines you feed to the labels and get pretty close to actually copy what multi-line labels do to begin with. You can't chop on bytes you have to chop on characters so hopefully the Roku can do this correctly using instr(index,$text," ") and index is the amount of characters you assume can fit the line if you can't get the GetOneLineWidth() to work with your custom fonts that work with any language such as Googles Noto. We could never make GetOneLineWidth() work reliably with right to left and string reverse. Maybe you can? Otherwise abandon it and instead count characters and assume a width-per-char to apply. You might always cut too soon but you can get it baby bear/goldilocks close. Where it is close enough for the government type of thing.

But like others said the rows don't start on the right. Scrolling doesn't start on the right. You would have to roll-your-own components for all of these too that over-ride the default behavior. Extend the component and then customize it. There may be more shortcomings to this that I do not see as I have not fully attempted this yet. It is possible though but you must go through effort to get there. Roku does not make any of this easy when you work outside their supported language set. You go off the map so to speak and have to forge your own roads.

It might also be possible to use a labellist and get the same effect as multiple labels without the limitation that wrap="true" imposes on labels? You need to try labellist and feed it cut lines as the list. This might also be possible and less math since you wouldn't need to track which label of the 10 to add data. You just append to the one labellist.

function stringReverse(input as String) as String
   newStr = ""
   for each char in input.split("")
      newStr = char + newStr
   end for
   return newStr
end function
 
mysatgo
Posts: 1
Joined: Sun Sep 08, 2019 12:19 am

Re: Right-to-left (RTL) Languages Support

Sun Sep 08, 2019 12:25 am

Hi , 

Did Roku solve the issue with Arabic Langauge as Interface and Search?

Thanks 

Who is online

Users browsing this forum: No registered users and 3 guests