Localization of wordpress: Date and Time

I am creating a blog site in Bangla language. I am using a localization file called bn_BD.mo for this pupose. It translates the whole site but the date and time remains english. Actually I am not getting the numbers converted to Bangla Language. I know the mo file will not help in these cases.

So I have extended my function.php file of the theme folder with following function

Read More
function make_bangla_number($str)
{
    $engNumber = array(1,2,3,4,5,6,7,8,9,0);
    $bangNumber = array('১','২','৩','৪','৫','৬','৭','৮','৯','০');
    $converted = str_replace($engNumber, $bangNumber, $str);

    return $converted;
}

add_filter( 'get_the_time', 'make_bangla_number' );
add_filter( 'the_date', 'make_bangla_number' );
add_filter( 'get_the_date', 'make_bangla_number' );
add_filter( 'comments_number', 'make_bangla_number' );
add_filter( 'get_comment_date', 'make_bangla_number' );
add_filter( 'get_comment_time', 'make_bangla_number' );

It converts the date of the every post. But my pagination numbers and archive remains same like following

জানুয়ারী 2012 which is translation of January 2012
ফেব্রুয়ারী 2012 which is translation of February 2012.

And the pagination looks like

পাতা 1 2 3 4 5 6 which is translation Page 1 2 3 4 5 6
But I want it to be in bangla digits like following.

পাতা ১ ২ ৩ ৪ ৫ ৬.

What should I do? Thanks in Advance.

Related posts

Leave a Reply

2 comments