Fwd: Joomla bangla

31 views
Skip to first unread message

Alamgir Mohammed

unread,
Aug 5, 2008, 9:19:13 AM8/5/08
to mu...@googlegroups.com


---------- Forwarded message ----------
From: Alamgir Mohammed <alam...@gmail.com>
Date: Thu, Jan 18, 2007 at 3:58 PM
Subject: Re: Joomla bangla
To: nurul amin russel <far...@yahoo.com>


Hello russel
What version of Joomla are you using?
Whatever is the version, you would find joomla.php in /include folder. Open that file with Notepad and locate the function mosFormatDate.

Just before the return $date statement add this codes:

//bangla hack begins

    $new = explode(",","$date");
       // New Day
       $Newday = $new[0];

       $new = explode(" ","$date");
       // New Date
       $Newdate = $new[1];
       // New Mouth
       $Newmounth = $new[2];
       $NewYear = $new[3];

//for days in bengali
       if($Newday == "Monday")
          $Newday = "সোমবার";
       else if($Newday == "Tuesday")
          $Newday = "মঙ্গলবার";
       else if($Newday == "Wednesday")
          $Newday = "বুধবার";
       else if($Newday == "Thursday")
          $Newday = "বৃহস্পতিবার";
       else if($Newday == "Friday")
          $Newday = "শুক্রবার";
       else if($Newday == "Saturday")
          $Newday = "শনিবার";
       else if($Newday == "Sunday")
          $Newday = "রবিবার";

       if($Newmounth == "January")
          $Newmounth = "জানুয়ারী";
       else if($Newmounth == "February")
          $Newmounth = "ফেব্রুয়ারী";
       else if($Newmounth == "March")
          $Newmounth = "মার্চ";
       else if($Newmounth == "April")
          $Newmounth = "এপ্রিল";
       else if($Newmounth == "May")
          $Newmounth = "মে";
       else if($Newmounth == "June")
          $Newmounth = "জুন";
       else if($Newmounth == "July")
          $Newmounth = "জুলাই";
       else if($Newmounth == "August")
          $Newmounth = "আগষ্ট";
       else if($Newmounth == "September")
          $Newmounth = "সেপ্টেম্বর";
       else if($Newmounth == "October")
          $Newmounth = "অক্টোবর";
       else if($Newmounth == "November")
          $Newmounth = "নভেম্বর";
       else if($Newmounth == "December")
          $Newmounth = "ডিসেম্বর";


       $date = $Newday.", ".$Newdate." ".$Newmounth." ".$NewYear;
   
//bangla hack ends


Save the php in utf-8 mode and upload back to the server. It should work.
If you find a "Header already sent by ......" kind of error in Browser let me know.

alamgir


On 1/18/07, nurul amin russel <far...@yahoo.com> wrote:
Hello Dear Alamgir Mohammed
How are you?

Can you please tell me how to show the dates in Bangla
?
Currently the published date of an article is showing
in Eng and I need it in Bangla. Is there any way to do
that?

Regards
Russel




____________________________________________________________________________________
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/


Omi Azad

unread,
Aug 5, 2008, 12:09:35 PM8/5/08
to mu...@googlegroups.com
Cool Hack. :)

Omi
-- 

--
Omi
http://omi.net.bd

Bangla Computing Projects: http://ekushey.org
OSS News in Bangla: http://mukto.org

Imran Hossain

unread,
Aug 5, 2008, 7:06:51 PM8/5/08
to mu...@googlegroups.com
But does it change the date to Bangla though?

Alamgir Mohammed

unread,
Aug 5, 2008, 7:34:27 PM8/5/08
to mu...@googlegroups.com
If you mean the numbers in the date then no  it does not.
This was done on January 07, a few months after Joomla came out.
To completely show date look at the other hack that was done for J 1.5.

cheers

Imran Hossain

unread,
Aug 5, 2008, 8:06:14 PM8/5/08
to mu...@googlegroups.com
Sorry, I should've been more specific. Yeah, I meant the numbers.

Thanks

Jewel

unread,
Aug 5, 2008, 10:26:42 PM8/5/08
to mu...@googlegroups.com
I need help for the number issue... my site showing everything in Bengali but number showing in English..I am using Joomla 1.x
some example:মঙ্গলবার, 05 আগস্ট 2008, প্রকাশিত লেখা: 430, সদস্য: 0 জন | অতিথি: 2 জন

plz help me.....
--
With Best Regards

Mohammed Osman Gani ( Jewel )
Chittagong, Bangladesh.
Home Page:- http://jewel.50webs.com/
Moderator of:- http://cae.com.bd/

Alamgir Mohammed

unread,
Aug 5, 2008, 10:40:00 PM8/5/08
to mu...@googlegroups.com
Jewel
Send me your
1. includes/joomla.php file (it varies depending on exact version 1.0.11, 1.0.12 etc)
2. get the other file from prokritipremik, and send to me. (I said I don't have the file anyomore)

Then I can sort that out in few minutes.

Cheers

Sabuj Kundu

unread,
Aug 5, 2008, 10:51:14 PM8/5/08
to mu...@googlegroups.com
Hi alamgir vai,

I used this little function to make digits in bangla format

function number_bangla($num)
{
$num=str_replace("0", "০",$num);
$num=str_replace("1", "১",$num);
$num=str_replace("2", "২",$num);
$num=str_replace("3", "৩",$num);
$num=str_replace("4", "৪",$num);
$num=str_replace("5", "৫",$num);
$num=str_replace("6", "৬",$num);
$num=str_replace("7", "৭",$num );
$num=str_replace("8", "৮",$num);
$num=str_replace("9", "৯",$num);
return $num;
}
function date_bangla($bangladate)
{
//st,nd,3rd,th
$bangladate=str_replace("st", "",$bangladate );
$bangladate=str_replace("nd", "",$bangladate );
$bangladate=str_replace("rd", "",$bangladate );
$bangladate=str_replace("th", "",$bangladate );
//0-9
$bangladate=str_replace("0", "০",$bangladate );
$bangladate=str_replace("1", "১",$bangladate );
$bangladate=str_replace("2", "২",$bangladate );
$bangladate=str_replace("3", "৩",$bangladate );
$bangladate=str_replace("4", "৪",$bangladate );
$bangladate=str_replace("5", "৫",$bangladate );
$bangladate=str_replace("6", "৬",$bangladate );
$bangladate=str_replace("7", "৭",$bangladate );
$bangladate=str_replace("8", "৮",$bangladate );
$bangladate=str_replace("9", "৯",$bangladate );
//am-pm
$bangladate=str_replace("am", "পূর্বাহ্ন",$bangladate );
$bangladate=str_replace("pm", "অপরাহ্ন",$bangladate );
//st,nd,3rd,th
$bangladate=str_replace("1st", "১লা",$bangladate );
$bangladate=str_replace("2nd", "২রা",$bangladate );
$bangladate=str_replace("3rd", "৩রা",$bangladate );
$bangladate=str_replace("4th", "৪ঠা",$bangladate );
$bangladate=str_replace("5th", "৫ই",$bangladate );
$bangladate=str_replace("6th", "৬ই",$bangladate );
$bangladate=str_replace("7th", "৭ই",$bangladate );
$bangladate=str_replace("8th", "৮ই",$bangladate );
$bangladate=str_replace("9th", "৯ই",$bangladate );
$bangladate=str_replace("10th", "১০ই",$bangladate );
return $bangladate;
}

Same thing can be done for day and month name
........................
Sabuj Kumar Kundu
http:/blog.manchumahara.com
http://forum.amaderprojukti.com
http://mkabya.page.tl

Sabuj Kundu

unread,
Aug 5, 2008, 10:56:55 PM8/5/08
to mu...@googlegroups.com
Another thing to notify:

Here from this code:

$new = explode(",","$date");
// New Day
$Newday = $new[0];

$new = explode(" ","$date");
// New Date
$Newdate = $new[1];
// New Mouth
$Newmounth = $new[2];
$NewYear = $new[3];

After spliting date with delimeter " " there may be problem if date is
not in proper format(Date can be formated in diff ways) and so
$Newmounth = $new[2]; this will not give always month name , i mean
index 2 . Am I wrong ?

Alamgir Mohammed

unread,
Aug 5, 2008, 11:05:11 PM8/5/08
to mu...@googlegroups.com
This one looks lot nicer.

Thanks sabuj.

Sabuj Kundu

unread,
Aug 5, 2008, 11:14:00 PM8/5/08
to mu...@googlegroups.com
I know this code is noisy but it works for all format or can be little
modified according to the format specified. Let me know how about this
code:

Find function mosFormatDate in includes/joomla.php and
Find return $date;
Add $date = number_bangla($date); before the above line

Add this function before mosFormatDate
function number_bangla($num)
{
//numbers

$num=str_replace("0", "০",$num);
$num=str_replace("1", "১",$num);
$num=str_replace("2", "২",$num);
$num=str_replace("3", "৩",$num);
$num=str_replace("4", "৪",$num);
$num=str_replace("5", "৫",$num);
$num=str_replace("6", "৬",$num);
$num=str_replace("7", "৭",$num );
$num=str_replace("8", "৮",$num);
$num=str_replace("9", "৯",$num);

//day sat , sun....
$num=str_replace("Saturday", "শনিবার",$num);
$num=str_replace("Sunday", "রবিবার",$num);
$num=str_replace("Monday", "সোমবার",$num);
$num=str_replace("Tuesday", "মঙ্গলবার",$num);
$num=str_replace("Wednesday", "বুধবার",$num);
$num=str_replace("Thursday", "বৃহঃবার",$num);
$num=str_replace("Friday", "শুক্রবার",$num );
//Month
//Please do rest for month like bellow line
$num=str_replace("June", "জুন",$num );
return $num;
}

This function should be modified accoring to needs i mean the date
format. It may take time but will cover all format ...

Imran Hossain

unread,
Aug 5, 2008, 11:24:01 PM8/5/08
to mu...@googlegroups.com
I like this hack :)

Jewel

unread,
Aug 6, 2008, 12:10:03 AM8/6/08
to mu...@googlegroups.com
My Site Problem Solved...Thanks a lot to everybody(Specially to Sabuj Bhai)....
Reply all
Reply to author
Forward
0 new messages