Roku Developer Program

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

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

Hi , 

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

Thanks 
0 Kudos
Highlighted
Level 8

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

I had a same problem but with Hebrew. I'm not a Roku developer but I've needed to solve this anyway. And I pretty solved it but there is a few issues still there. It was really challenge for me because I came from OOP world of .Net/C#, NodeJS etc.

Let's nail all challenges one by one:

  1. Letters appear in reverse order:
    • Solution: this is a simple part that you can fix with reverseString function
    • Problem: it works only for plain text, without any other symbols (see p.3)
  2. Multi-line text lines appear in reverse order:
    • Solution: I wrote BreakLines function that divides text in N lines (with whole words cuts). Than I used N labels instead of multi-text area. And filled them with lines.
    • Problem: the same as in p.1 - works only for plane texts. And also need to control long texts that labels not overlap another elements.
  3. Mixed text: That is a huuuuuge problem. There are a few subjects that should be addressed in RTL text processing:
  • numbers: they are always LTR, not need to reverse 
  • special symbols: it's a huge challenge when you have words delimiters like (), [], {}, dash and finally - quotes in any types (", ', `). You should count them as word delimiters like spaces but not always (single quote can be a part of word like "don't")
  • few languages together (like text in Hebrew and English name of company in the middle, or more complicated - name of song or product)

All of this forced me to split my development between server and client (that is not really best practice, but I haven't a choice - BrightScript is a weak language with lack of basic functionality of strings processing and arrays manipulations Smiley Frustrated ). My solution was to divide text by language regions where is RTL or LTR direction and process them separately (server-side algorithm). Than this text come to client via API ready to display, except of multi-line appearance that is implemented in application. And after all of this - there are few annoying issues in UI still there :-\

Now, guys, you understand why Roku don't support RTL :-D

That was an interesting challenge for my 25-years development experience and I think I did my best to solve this not-trivial problem. I spent around 4 full days for this (with back and force with different approaches) but it was interesting :-)

0 Kudos