Wintermute
Wintermute

Reputation: 3045

php setlocale arabic strftime

I've run locale -a on my server and can see that it's got Arabic locale settings installed:

However, if I set the locale via:

$locale = array('ar_AE', 'ar_AE.iso88596', 'ar_AE.utf8', 'ar');
setlocale(LC_TIME, $locale);

and output it:

strftime('%A %d %B', $current_date)

The displayed date is in English, not Arabic.

Arabic is the only language this isn't working for: the site I'm working on is in 15 languages and all the others display a translated date.

What's going wrong?

Upvotes: 5

Views: 4415

Answers (1)

syrkull
syrkull

Reputation: 2344

This worked for me with no problems at all.

setlocale(LC_ALL, 'ar_AE.utf8');

If this does not work, then there is another code in your PHP file that interferes with the language.

Upvotes: 7

Related Questions