Forums

Discussions of the easy to use open source game control panel.

You are not logged in.

Announcement

Welcome on board ! We are very proud to present you our forums powered by FluxBB ! Please Register, do not forget to read carefully Forum Rules and feel free to Contact Us if you see any problems. Finally, take part in site life !

#1 2013-12-19 17:09:49

longapan
Member
Registered: 2013-12-10
Posts: 8

How I can translate the date?

hi guys, How I can translate the date of the panel? I would like to have records of Spanish date

thanks

Offline

#2 2013-12-19 17:44:04

warhawk
Administrator
From: France
Registered: 2013-05-29
Posts: 256
Website

Re: How I can translate the date?

to my mind, you can't : it is an internal PHP function :-(

Offline

#3 2013-12-19 18:00:23

ThunderGod
Member
Registered: 2013-11-30
Posts: 56

Re: How I can translate the date?

Okay first:

Go to /includes/ and open func.lang.inc.php .
Then after

[== PHP ==]
//Prevent direct access
if (!defined('LICENSE'))
{
	exit('Access Denied');
}

add this code :

[== PHP ==]
//Date Language
function lang_date($format, $date=FALSE)
{
    $months['January'] = T_('January');
    $months['February'] = T_('February');
    $months['March'] = T_('March');
    $months['April'] = T_('April');
    $months['May'] = T_('May');
    $months['June'] = T_('June');
    $months['July'] = T_('July');
    $months['August'] = T_('August');
    $months['September'] = T_('September');
    $months['October'] = T_('October');
    $months['November'] = T_('November');
    $months['December'] = T_('December');

    $days['Monday'] = T_('Monday');
    $days['Tuesday'] = T_('Tuesday');
    $days['Wednesday'] = T_('Wednesday');
    $days['Thursday'] = T_('Thursday');
    $days['Friday'] = T_('Friday');
    $days['Saturday'] = T_('Saturday');
    $days['Sunday'] = T_('Sunday');

    if ($date)
        $date = date($format, strtotime($date));
    else
        $date = date($format, time());

    foreach ($months as $key => $val)
        $date = str_replace($key, $val, $date);
    foreach ($days as $key => $val)
        $date = str_replace($key, $val, $date);

    return $date;
}

Save it.

Then open bootstrap/header.php, find "date('l | F j, Y | H:i');" and change it to "lang_date('l | F j, Y | H:i');"
Then open admin/bootstrap/header.php, find "date('l | F j, Y | H:i');" and change it to "lang_date('l | F j, Y | H:i');"
Then open includes/func.misc.inc.php, find
"date('l | F j, Y | H:i', mktime($dateTable['hour'], $dateTable['minute'], $dateTable['second'], $dateTable['month'], $dateTable['day'], $dateTable['year']));"
and change it to
"lang_date('l | F j, Y | H:i', mktime($dateTable['hour'], $dateTable['minute'], $dateTable['second'], $dateTable['month'], $dateTable['day'], $dateTable['year']));"

save the files.

Then download This , and extract it in /locale/,
when it asks for overwrite press yes.


After that your date should be in spanish (if the site language is set to spanish)

Last edited by ThunderGod (2013-12-20 07:45:26)


FirmaHatsuneMikuCRabling-1.png

Offline

#4 2013-12-19 21:07:58

warhawk
Administrator
From: France
Registered: 2013-05-29
Posts: 256
Website

Re: How I can translate the date?

Okay... Very nice dude, no time to do this...  ]:D

Offline

#5 2013-12-20 03:54:43

longapan
Member
Registered: 2013-12-10
Posts: 8

Re: How I can translate the date?

ThunderGod wrote:

Okay first:

Go to /includes/ and open func.lang.inc.php .
Then after

[== PHP ==]
//Prevent direct access
if (!defined('LICENSE'))
{
	exit('Access Denied');
}

add this code :

[== PHP ==]
//Date Language
function lang_date($format, $date=FALSE)
{
    $months['January'] = T_('January');
    $months['February'] = T_('February');
    $months['March'] = T_('March');
    $months['April'] = T_('April');
    $months['May'] = T_('May');
    $months['June'] = T_('June');
    $months['July'] = T_('July');
    $months['August'] = T_('August');
    $months['September'] = T_('September');
    $months['October'] = T_('October');
    $months['November'] = T_('November');
    $months['December'] = T_('December');

    $days['Monday'] = T_('Monday');
    $days['Tuesday'] = T_('Tuesday');
    $days['Wednesday'] = T_('Wednesday');
    $days['Thursday'] = T_('Thursday');
    $days['Friday'] = T_('Friday');
    $days['Saturday'] = T_('Saturday');
    $days['Sunday'] = T_('Sunday');

    if ($date)
        $date = date($format, strtotime($date));
    else
        $date = date($format, time());

    foreach ($months as $key => $val)
        $date = str_replace($key, $val, $date);
    foreach ($days as $key => $val)
        $date = str_replace($key, $val, $date);

    return $date;
}

Save it.

Then open bootstrap/header.php, find "date('l | F j, Y | H:i');" and change it to "lang_date('l | F j, Y | H:i');"
Then open admin/bootstrap/header.php, find "date('l | F j, Y | H:i');" and change it to "lang_date('l | F j, Y | H:i');"
save both of the files.

Then download This , and extract it in /locale/,
when it asks for overwrite press yes.


After that your date should be in spanish (if the site language is set to spanish)


5Sqnk.png

very very nice, thank you! but cant changes here??

5SqlE.png

Last edited by longapan (2013-12-20 04:07:15)

Offline

#6 2013-12-20 07:45:50

ThunderGod
Member
Registered: 2013-11-30
Posts: 56

Re: How I can translate the date?

I updated my post check it.


FirmaHatsuneMikuCRabling-1.png

Offline

#7 2013-12-20 16:25:11

longapan
Member
Registered: 2013-12-10
Posts: 8

Re: How I can translate the date?

:8   nice, now all trasladate

5SQuY.png

thank you !!

Offline

Board footer

Powered by FluxBB