Help - Search - Member List - Calendar
Full Version: [2.1.x Mods Mineures] Dates en français
IPBR-FR > Divers > Documentation > Soumettez vos astuces ou tutoriels
leboss10
Voici Comment Mettre La Dates en français Pour Les Version D'IPB 2.1.x

Fichier A éditer :
sources/ipsclass.php
sources/action_public/profile.php
sources/lib/admin_functions.php

---------------------------------------------------------------------------------------

Ouvrir sources/ipsclass.php

Après le code
QUOTE
function get_date($date, $method, $norelative=0, $full_relative=0)
   {

Il faut rajouter
QUOTE
setlocale(LC_ALL, 'fr', 'fr_FR', 'french');


Aux environs de la ligne 3159.
Remplacer
QUOTE
return gmdate($this->time_options[$method], ($date + $this->offset) );

Par
QUOTE
return gmstrftime($this->time_options[$method], ($date + $this->offset) );
   //return gmdate($this->time_options[$method], ($date + $this->offset) );


Ensuite, Trouver
QUOTE
if ( $this_time == $this->today_time )
  {
   return str_replace( '{--}', $this->lang['time_today'], gmstrftime($this->vars['time_use_relative_format'], ($date + $this->offset) ) );
  }
  else if  ( $this_time == $this->yesterday_time )
  {
   return str_replace( '{--}', $this->lang['time_yesterday'], gmstrftime($this->vars['time_use_relative_format'], ($date + $this->offset) ) );
  }
  else
  {
   return gmstrftime($this->time_options[$method], ($date + $this->offset) );
  }
}

//-----------------------------------------
// Normal
//-----------------------------------------

else
{
        return gmstrftime($this->time_options[$method], ($date + $this->offset) );
       }
   }


Remplacer Par
QUOTE
if ( $this_time == $this->today_time )
  {
   return str_replace( '{--}', $this->lang['time_today'], gmstrftime($this->vars['time_use_relative_format'], ($date + $this->offset) ) );
  }
  else if  ( $this_time == $this->yesterday_time )
  {
   return str_replace( '{--}', $this->lang['time_yesterday'], gmstrftime($this->vars['time_use_relative_format'], ($date + $this->offset) ) );
  }
  else
  {
   return ucwords(gmstrftime($this->time_options[$method], ($date + $this->offset) ));
  }
}

//-----------------------------------------
// Normal
//-----------------------------------------

else
{
        return ucwords(gmstrftime($this->time_options[$method], ($date + $this->offset) ));
       }
   }


Ensuite Ouvrir sources/action_public/profile.php

Cherchez :
QUOTE
    $info['local_time']  = $member['time_offset'] != "" ? gmdate( $this->ipsclass->vars['clock_long'], time() + ($member['time_offset']*3600) + ($this->ipsclass->vars['time_adjust'] * 60) ) : $this->ipsclass->lang['no_info'];

Remplacez par :
QUOTE
    $info['local_time']  = $member['time_offset'] != "" ? gmstrftime( $this->ipsclass->vars['clock_long'], time() + ($member['time_offset']*3600) + ($this->ipsclass->vars['time_adjust'] * 60) ) : $this->ipsclass->lang['no_info'];


Ouvrir sources/lib/admin_functions.php

Cherchez :
QUOTE
return gmdate($this->time_options[$method], ($date + $this->time_offset) );

Remplacez par :
QUOTE
setlocale(LC_TIME, 'french');
return gmstrftime($this->time_options[$method], ($date + $this->time_offset) );


------------------------------------------------------------------------------

Pour Afficher Ses Modifications,

Il Faut Se Rendre Dans,

l'admin CP -> Generals Settings -> Date & Time formats :

Short time format : %A %d %B %Y à %H:%M

Join date time format : %d/%m/%Y

Long time format : %A %d %B %Y à %H:%M

Relative time format : {--}, %H:%M

--------------------------------------------------------------

Merci a Athanor, The Jedi, Schizo-Virus et Noctis.
Source : http://forums.invisionboard.fr/index.php?s...opic=21428&st=0
PrOdiGy
Merci a toi pour cette astuce mais est tu bien sûr que ca traduuise la date bien partout sur le forum ? (calendrier etc ... )
leboss10
essaye, tu verra :-)
Schizo-Virus
Salut.
Je tiens à te remercier d'avoir remis ce tuto.
Je l'avais crée sur ce forum même, mais ça a été perdu suite à une remonte de backup MySQL d'IPBR-FR.
Tchao.
leboss10
le plaisir est pour moi :-)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.