Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top