forked from Wavyzz/dolibarr
Fix: Pb de locale
This commit is contained in:
@@ -34,7 +34,19 @@ require("./pre.inc.php");
|
||||
llxHeader();
|
||||
|
||||
|
||||
print_fiche_titre( "Dolibarr ".DOL_VERSION,'');
|
||||
print_titre("Dolibarr");
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print "\n";
|
||||
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("Version")."</td><td>".DOL_VERSION."</td></tr>\n";
|
||||
print "<tr $bc[1]><td width=\"240\">".$langs->trans("Language")." (LC_ALL)</td><td>".setlocale(LC_ALL,0)."</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<p>';
|
||||
print $langs->trans("Dolibarr est publi<6C> sous licence GNU/GPL");
|
||||
|
||||
@@ -45,6 +45,7 @@ print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"2\">Dolibarr</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("Version")."</td><td>" . DOL_VERSION . "</td></tr>\n";
|
||||
print "<tr $bc[1]><td width=\"240\">".$langs->trans("Language")." (LC_ALL)</td><td>".setlocale(LC_ALL,0)."</td></tr>\n";
|
||||
print '</table>';
|
||||
|
||||
print "<br>\n";
|
||||
@@ -62,6 +63,7 @@ print '</table>';
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
// Serveur web
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("WebServer")."</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
|
||||
@@ -71,6 +73,7 @@ print '</table>';
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
// Php
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("Php")."</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("Version")."</td><td>".phpversion()."</td></tr>\n";
|
||||
@@ -79,6 +82,7 @@ print '</table>';
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
// Base de donn<6E>e
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("Database")."</td></tr>\n";
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$lan
|
||||
print "\n";
|
||||
|
||||
// R<>cup<75>re l'OS au sens PHP
|
||||
print "<tr $bc[0]><td width=\"140\"><b>".$langs->trans("PHP_OS")."</b></td><td>".PHP_OS."</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("PHP_OS")."</td><td>".PHP_OS."</td></tr>\n";
|
||||
|
||||
// R<>cup<75>re la version de l'OS
|
||||
ob_start();
|
||||
@@ -52,7 +52,7 @@ phpinfo();
|
||||
$chaine = ob_get_contents();
|
||||
ob_end_clean();
|
||||
eregi('System </td><td class="v">([^\/]*)</td>',$chaine,$reg);
|
||||
print "<tr $bc[1]><td width=\"140\"><b>".$langs->trans("Version")."</b></td><td>".$reg[1]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td width=\"240\">".$langs->trans("Version")."</td><td>".$reg[1]."</td></tr>\n";
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
@@ -41,11 +41,12 @@ print "<br>\n";
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\"><td>".$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"200\">".$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td>".$langs->trans("VirtualServerName")."</td><td>" . $_SERVER["SERVER_NAME"] . "</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"200\">".$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td>".$langs->trans("Port")."</td><td>" . $_SERVER["SERVER_PORT"] . "</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"200\">".$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td>".$langs->trans("DataRootServer")."</td><td>" . DOL_DATA_ROOT . "</td></tr>\n";
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
@@ -312,36 +312,36 @@ function dolibarr_time_plus_duree($time,$duration_value,$duration_unit)
|
||||
|
||||
|
||||
/**
|
||||
\brief Formattage de la date
|
||||
\param time date timestamp ou au format YYYY-MM-DD
|
||||
\param format format de la date "%d %b %Y"
|
||||
\return string date format<61>e
|
||||
\brief Formattage de la date en fonction de la langue $conf->langage
|
||||
\param time date 'timestamp' ou format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS'
|
||||
\param format format d'affichage de la date "%d %b %Y"
|
||||
\return string date format<61>e
|
||||
*/
|
||||
function dolibarr_print_date($time,$format="%d %b %Y")
|
||||
{
|
||||
// Analyse de la date
|
||||
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?',$time,$reg)) {
|
||||
// Date au format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS'
|
||||
$syear = $reg[1];
|
||||
$smonth = $reg[2];
|
||||
$sday = $reg[3];
|
||||
$shour = $reg[4];
|
||||
$smin = $reg[5];
|
||||
if ($syear < 1970 && $_SERVER["WINDIR"])
|
||||
{
|
||||
// Le formatage ne peut etre appliqu<71> car windows ne supporte pas la fonction
|
||||
// mktime si l'ann<6E>e est inf<6E>rieur <20> 1970. On retourne un format fixe
|
||||
return "$syear-$smonth-$sday";
|
||||
}
|
||||
else
|
||||
{
|
||||
return strftime($format,mktime($shour,$smin,0,$smonth,$sday,$syear));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Date est un timestamps
|
||||
return strftime($format,$time);
|
||||
}
|
||||
// Analyse de la date
|
||||
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?',$time,$reg)) {
|
||||
// Date au format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS'
|
||||
$syear = $reg[1];
|
||||
$smonth = $reg[2];
|
||||
$sday = $reg[3];
|
||||
$shour = $reg[4];
|
||||
$smin = $reg[5];
|
||||
if ($syear < 1970 && $_SERVER["WINDIR"])
|
||||
{
|
||||
// Le formatage ne peut etre appliqu<71> car windows ne supporte pas la fonction
|
||||
// mktime si l'ann<6E>e est inf<6E>rieur <20> 1970. On retourne un format fixe
|
||||
return "$syear-$smonth-$sday";
|
||||
}
|
||||
else
|
||||
{
|
||||
return strftime($format,mktime($shour,$smin,0,$smonth,$sday,$syear));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Date est un timestamps
|
||||
return strftime($format,$time);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -167,10 +167,13 @@ if (! defined('MAIN_LANG_DEFAULT'))
|
||||
}
|
||||
$conf->langage=MAIN_LANG_DEFAULT;
|
||||
|
||||
// On corrige $conf->language si il ne vaut pas le code long: fr_FR par exemple
|
||||
// On corrige $conf->langage si il ne vaut pas le code long: fr -> fr_FR par exemple
|
||||
if (strlen($conf->langage) <= 3) {
|
||||
$conf->langage = strtolower($conf->langage)."_".strtoupper($conf->langage);
|
||||
}
|
||||
$conf->langage_tiret=ereg_replace('_','-',$conf->langage);
|
||||
|
||||
setlocale(LC_ALL, $conf->langage_tiret); // Compenser pb de locale avec windows
|
||||
setlocale(LC_ALL, $conf->langage);
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/translate.class.php");
|
||||
|
||||
Reference in New Issue
Block a user