0

When I call setlocale(LC_ALL, "ar_SA"), it returns "C". Even I'm expecting it returns "ar_SA". If setlocale(LC_ALL, "ar_SA") is successful, it'll return "ar_SA".

I found the reason. There is no "ar_SA" locale directory in /usr/share/locale of my Mac OSX system.

I'm using gettext function. I should change the locale to "ar_SA".

  1. How can I install "ar_SA" locale directory into my Mac?
  2. Does Mac system in arabic country include arabic locale directory like /usr/share/locale/ar_*?
  3. Is there any work around?

Thank you.

Raymond
  • 473
  • 3
  • 18

1 Answers1

-4

I just copied en_US locale directory to ar_SA locale directory to make ar_SA locale.

Obviously fake ar_SA doesn't work. It works same as en_US.

But I can set locale to ar_SA.

This is a workaround I found.

Raymond
  • 473
  • 3
  • 18
  • 1
    This seems like a stupid answer, right, so people downvoted it. But actually, it works in some cases when all you need to do is have the locale set to that value without actually needed whatever is in those directories. For example, running a windows application in wine, I need the application to see the locale set to ar_US. Apparently, it contains it's own dependencies to be able to display menus and everything. So this workaround works. Voted up. If you haven't tried it, please don't jump to conclusions and vote down. – meelash Aug 25 '18 at 17:37