Arabic Date WordPress Plugin

This plugin contain simple code to handles ONLY the translation of numbers used in dates.
No options needed, the plugin will work only if it detects Arabic as the website language.

Its an updated version of the plugin “Arabic-Indic Numerals for Arabic WordPress

the code filter the results from date_i18n() function and replace the english numbers with Arabic

here is the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function convert_numbers_to_arabic($n) {
    $arabic_numbers = array('۰', '۱', '۲', '۳', '٤', '۵', '٦', '۷', '۸', '۹', '.');
	$english_numbers = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.');
	return str_replace($english_numbers, $arabic_numbers, $n);
}
 
function arabic_date_i18n( $j ) {
	if ( get_bloginfo( 'language' ) == 'ar' ) {
		$j = convert_numbers_to_arabic( $j );
	}
	return $j;
}
 
add_filter('date_i18n', 'arabic_date_i18n');

Other dates keywords usually should be handled by propor .mo files, even date’s months or day names.

WPML is Recommended plugin to handle content and theme translations

you can download the plugin here

http://mohammad-sabbagh.com/wp-content/uploads/2015/05/arabic-date.zip