phpScheduleIt
June 19, 2013, 03:34:00 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Translation Issue  (Read 678 times)
Metak
Newbie
*

Karma: 0
Posts: 2


« on: March 01, 2012, 11:11:31 AM »

Hi,

I'am actually trying to translate the days name in the schedule page.

Although i choose the french package, the days il the schedule page remain in english (even in the demo on the official website).

I assume this is due to the Php function returning days in english by default.


As a newbie developper i tried to locate where are displayed those days i need to translate and ended up in  tpl/schedule.tpl, but whenever i modify this file,
there is no modification on the site. I thought that perhaps scheduleit is using some sort of cache system, but i can't figure it out.

Do you have any ideas on where to put a If condition to modify displaying of those dates please ?

Thanks.
« Last Edit: March 01, 2012, 11:18:14 AM by Metak » Logged
Metak
Newbie
*

Karma: 0
Posts: 2


« Reply #1 on: March 02, 2012, 09:35:26 AM »

Just got how the cache system work and located the code i need to change :


$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['formatdate'][0][0]->FormatDate(array('date'=>$_smarty_tpl->tpl_vars['date']->value,'key'=>"schedule_daily"),$_smarty_tpl);

This create the date in english. i need to isolate the day name and translate it.

Thanks
Logged
KarenMcDaniel
Newbie
*

Karma: 0
Posts: 2


WWW
« Reply #2 on: March 03, 2012, 03:50:11 AM »

Just got how the cache system work and located the code i need to change :


$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['formatdate'][0][0]->FormatDate(array('date'=>$_smarty_tpl->tpl_vars['date']->value,'key'=>"schedule_daily"),$_smarty_tpl);

This create the date in english. i need to isolate the day name and translate it.

Thanks

Hi, there.
I Google some more tips for you here, Translate date() PHP in french, from dzone.com:

function date_french($format, $timestamp = null) {
   $param_D = array('', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam', 'Dim');
   $param_l = array('', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche');
   $param_F = array('', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre');
   $param_M = array('', 'Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun', 'Jul', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc');
$return = '';
   if(is_null($timestamp)) { $timestamp = mktime(); }
   for($i = 0, $len = strlen($format); $i < $len; $i++) {
      switch($format[$i]) {
         case '\\' : // fix.slashes
            $i++;
            $return .= isset($format[$i]) ? $format[$i] : '';
            break;
         case 'D' :
            $return .= $param_D[date('N', $timestamp)];
            break;
         case 'l' :
            $return .= $param_l[date('N', $timestamp)];
            break;
         case 'F' :
            $return .= $param_F[date('n', $timestamp)];
            break;
         case 'M' :
            $return .= $param_M[date('n', $timestamp)];
            break;
         default :
            $return .= date($format[$i], $timestamp);
            break;
      }
   }
   return $return;
}

Thank you, good day. Smiley
« Last Edit: March 21, 2012, 11:15:32 PM by KarenMcDaniel » Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #3 on: March 05, 2012, 01:36:32 PM »

Hi,
This is a bug that I will have fixed in the 2.1 release.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!