Hi, first of all, it’s an old tutorial, I don’t use Drupal 6.x any more. Anyway, below goes the procedures.

WARNING: This is done hacking core Drupal files, so be careful when you update Drupal core. All changes might be lost.

Edit file ‘DRUPAL_INSTALL_DIR/includes/common.inc

Add following code snippet at the end of t($string, $args = array(), $langcode = NULL) function:

if($langcode == 'bn'){
return bengaliDigit(strtr($string, $args));
return strtr($string, $args);

And define following function somewhere in the page:

function bengaliDigit($numb){
// Credits: Hasan Raihan
$latin = array('1','2','3','4','5','6','7','8','9','0');
$bengali = array('১','২','৩','৪','৫','৬','৭','৮','৯','০',);
return str_replace($latin, $bengali, $numb);

Here, I’m assuming I’m translating English (en) digits to Bengali (bn) Digits.

3 thoughts on “Translate Digits/numbers in Drupal 6.x

Comments are closed.