Right to Left text alignment

Hi there,

It seems that Corona Simulator does not fully support bidi or right-to-left (RTL) language such as Arabic. I can type in Arabic and the text is displayed, but the text is left aligned. How can I force RTL alignment? Any ideas? This is a show-stopper for Arabic ebooks’ development.

Thanks,
Mohamed [import]uid: 113216 topic_id: 19752 reply_id: 319752[/import]

not exactly what you needing but will point you in the right direction. read the comments

http://developer.anscamobile.com/code/keeping-score-aligned [import]uid: 7911 topic_id: 19752 reply_id: 76521[/import]

Marhaba Mohamed,

That’s a valid point. I think you should issue a bug-report on this so that it will get on their to-do list :slight_smile:
[import]uid: 70847 topic_id: 19752 reply_id: 76557[/import]

Thanks jstrahan and ingemar for your replies. I will report this. Can I issue a bug-report even if I am not a subscriber yet?

Shukran ingemar :slight_smile: [import]uid: 113216 topic_id: 19752 reply_id: 76847[/import]

Afwan Mohamed,

I would expect that you can report a bug.
You should be able to see the “Report a bug” link at the top of the page. [import]uid: 70847 topic_id: 19752 reply_id: 76848[/import]

Hi Mohamed
do you have a piece of code you don’t mind to share showing how you can display Arabic texts ?

SHukran :slight_smile: [import]uid: 94804 topic_id: 19752 reply_id: 76898[/import]

Thanks ingemar. I will report a bug. In the mean time, Peach Pellen asked me to provide some Arabic text.

Here it is:

local textObject = display.newText( “??? ??? ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??: ??? ??? ??? ???.”, 50, 50, native.systemFont,20 );
textObject:setTextColor ( 255, 255, 255 );
@naddari, you can use the above sample code to display Arabic on the Corona terminal.

I wish there was a way to attach screen shots. [import]uid: 113216 topic_id: 19752 reply_id: 77229[/import]

@mohamed
Yeah, I’m familiar with these kind of problems.
I lived in Riyadh for 7 years (working for ABV) and we had similar problems getting Arabic text to store in our UNIX databases and format properly for display… [import]uid: 70847 topic_id: 19752 reply_id: 77236[/import]

Thanks You Mohamad for the reply.

I tried that already and I only see strange characters in the screen. I’m running the version 2.0.0 build 2011.704 of the SDK running on a windows 7 enterprise (English).

Do you have any special build.settings file ? on what OS you are running Corona ?

Thank you for your help. [import]uid: 94804 topic_id: 19752 reply_id: 77243[/import]

Hi naddari,

I have the same version and I am running Windows 7 Pro, 64 bit.

I am not sure what is the problem at your end. but you may need to check your regional settings. [import]uid: 113216 topic_id: 19752 reply_id: 77439[/import]

Hi naddari,

Go to Control Panel\Region and Language

Go to the last tab ‘Administrative’. Click on ‘Change System Locale’ and select from the drop-down list 'Arabic (Saudi Arabia) for example. Restart your PC if needed and then give it another try. I think this will fix your problem.

Thanks,
Mohamed [import]uid: 113216 topic_id: 19752 reply_id: 77477[/import]

@ingemar
Arabic is always difficult to deal with due to the lack of native support in many programs. We have to find some workarounds sometimes. I hope the Arabic community here share their tips and tricks so other people can benefit from it. [import]uid: 113216 topic_id: 19752 reply_id: 77478[/import]

I tried to change the ‘Change System Locale’ but not helping, I think I should add Arabic to the list of display language, I don t have it now. DO you have it Mohamed on your machine ? (to check => control panel=>Clock, Language, and Region => Install or uninstall Display languages => choose uninstall Display languages just to check the list).

Thank Again and apologize I hijacked the original subject this post is about :slight_smile:

Dev [import]uid: 94804 topic_id: 19752 reply_id: 77618[/import]

I also added Arabic as the main display language but still the same problem…
The code I put is
local textObject = display.newText( " ??? ???.", 50, 50, native.systemFont,20 );
textObject:setTextColor ( 255, 255, 255 );
Corona launched an nice initiative called “Corona Ambassador” which is inline with prioritizing and solving this issue.

Anyone from the team to help please… [import]uid: 94804 topic_id: 19752 reply_id: 77718[/import]

@dev.naddari

So, do you see now Arabic added in the list of languages mentioned above? Did you manage to add Arabic Saudi Arabia or Arabic Egypt? If you do not see them, then there is something wrong with your machine locale. [import]uid: 113216 topic_id: 19752 reply_id: 78559[/import]

Hi,

I think the problem is with text editor which you are using.

Please check your text editor is supporting arabic language or not.

Here is the code for displaying arabic text.
<lua>
local textObject = display.newText( “شروع اللہ کے نام سے جو بڑامہربان، نہایت رحم والا ہے۔z”, 50, 50, native.systemFont,20 );
textObject:setTextColor ( 255, 255, 255 );
</lua>

Thanks.

Form public build 2013.1202 there is option to align text (left, centr, right)

Hi,

I think the problem is with text editor which you are using.

Please check your text editor is supporting arabic language or not.

Here is the code for displaying arabic text.
<lua>
local textObject = display.newText( “شروع اللہ کے نام سے جو بڑامہربان، نہایت رحم والا ہے۔z”, 50, 50, native.systemFont,20 );
textObject:setTextColor ( 255, 255, 255 );
</lua>

Thanks.

Form public build 2013.1202 there is option to align text (left, centr, right)

hi, all, I am hoping to add Arabic localization to my app, Seven Minutes. Have you found a way to add right-to-left text alignment properly to buttons? I’m not able to even make text.align for display.newText really display right to left ( I think when they say align, they mean justify? )

Any tips…is it standard to have Arabic apps be right-to-left screen layout?

thanks,

Jen