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.
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?
I have been searching for any "Bidi" articles or information for Cocoa apps for a while now, but without much luck. Any suggestions?
Thanks.
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.