Translate Digits/numbers in Drupal 6.x

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/

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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s