As you’re reading this article, I guess you are a proud WordPressian and you have interests on WordPress like me.
Have you ever wanted to convert the digits into Bengali (or other language) while translating a site? You can easily translate your site to another language using a language pack. And absolutely it was never been difficult to convert digits to Bengali/Bangla or whatever language you want!
Bengali Digits in WordPress
Just follow the instructions I’m giving below. But, please do not do this, if you do not have basic knowledge of PHP.
1. Find out the file named functions.php. This file is located in wp-content/themes/your_theme/functions.php
2. Open it with NotePad or any other editor.
3. Copy the code below
$en_digit = array(1,2,3,4,5,6,7,8,9,0);
$converted = str_replace($en_digit, $bn_digit, $str);
add_filter( 'get_the_time', 'digit_e2b' );
add_filter( 'the_date', 'digit_e2b' );
add_filter( 'comments_number', 'digit_e2b' );
add_filter( 'get_comment_date', 'digit_e2b' );
add_filter( 'get_comment_time', 'digit_e2b' );
add_filter( 'wp_list_comments', 'digit_e2b' );
4. Paste them in functions.php file. Be careful about right placement. Keep them inside <?php and ?> tag.
5. Save the file.
6. Now reload/refresh your website and see the changes.
[Note: in 4th line, I wrote
$bn_digit = array(১,২,৩,৪,৫,৬,৭,৮,৯,০);
Where ১,২,৩,৪,৫,৬,৭,৮,৯,০ are the numbers from Bengali Language. If you want to use your own digits, just put them separated with commas.]