views:

146

answers:

1

Hello!

I recently received an Arabic translation for my app, but would like to do more than simply replace the strings. I can re-layout most of the NIBs with Interface builder, but there are a few things that I need to do programmatically.

  1. Is there some way in Cocoa to figure out if the current locale is a RightToLeft locale, or do I just have to check to see if the current locale is Arabic or Hebrew?

  2. I have been searching for any "Bidi" articles or information for Cocoa apps for a while now, but without much luck. Any suggestions?

Thanks.

A: 

Okay, I was waiting until today to answer this. :-)

In 10.6, see -[NSApplication userInterfaceLayoutDirection]. For earlier releases, no explicit support, so yeah, you could just look for specific locales.

You can do a respondsToSelector check to use -userInterfaceLayoutDirection on any system on which it is available.

See the AppKit release notes for this and other changes.

Ken
I think the answer is: OS X's bidi support is still not that great. I managed to muddle through it in apps thus far, but found that even when set to RTL reading, some controls are wonky. Oh well, my app does work in Arabic now :)