objective-cmacosright-to-leftnsalert

NSAlert for right to left languages (reversed layout)


I want to create localized NSAlert for right to left language like Arabic and Hebrew.

How can I reverse the layout so that Icon is on the right, TextField on the left, and also buttons start from the left side of the alert?

I can't seem to find the proper answer anywhere.

Thanks, N


Solution

  • Apple has a Human Interface Guidelines that are somewhat strict about the ordering & placement of things. For example, in the "Place buttons appropriately" section of this HIG documentation, buttons most likely to be touched usually go on the right.

    If NSAlert behavior doesn't look right to you, the easiest way to rearrange things is to implement your own NSView customized to look like a NSAlert. But if Apple hasn't changed the order of things for Right-to-Left languages, then it's a pretty safe bet that most of your Arabic & Hebrew customers are going to be expecting their buttons to be placed in the same place where all other apps are going to have their buttons placed. That is, the button that's most likely to be touched should still be in the bottom right.