Fix: Translation of month should be ok.

This commit is contained in:
Laurent Destailleur 2009-02-07 00:55:23 +00:00
parent b1165d90fb
commit e472e6cff8
5 changed files with 13 additions and 26 deletions

View File

@ -69,14 +69,12 @@ $var=!$var;
print "<tr ".$bc[$var]."><td width=\"300\">".$langs->trans("LanguageParameter","PHP LC_ALL")."</td><td>".setlocale(LC_ALL,0)."</td></tr>\n"; print "<tr ".$bc[$var]."><td width=\"300\">".$langs->trans("LanguageParameter","PHP LC_ALL")."</td><td>".setlocale(LC_ALL,0)."</td></tr>\n";
$var=!$var; $var=!$var;
print "<tr ".$bc[$var]."><td width=\"300\">".$langs->trans("LanguageParameter","PHP LC_NUMERIC")."</td><td>".setlocale(LC_NUMERIC,0)."</td></tr>\n"; print "<tr ".$bc[$var]."><td width=\"300\">".$langs->trans("LanguageParameter","PHP LC_NUMERIC")."</td><td>".setlocale(LC_NUMERIC,0)."</td></tr>\n";
$var=!$var;
print "<tr ".$bc[$var]."><td width=\"300\">".$langs->trans("LanguageParameter","PHP LC_TIME")."</td><td>".setlocale(LC_TIME,0)."</td></tr>\n";
//$var=!$var; //$var=!$var;
//print "<tr ".$bc[$var]."><td width=\"300\">".$langs->trans("LanguageParameter","PHP LC_MONETARY")."</td><td>".setlocale(LC_MONETARY,0)."</td></tr>\n"; //print "<tr ".$bc[$var]."><td width=\"300\">".$langs->trans("LanguageParameter","PHP LC_MONETARY")."</td><td>".setlocale(LC_MONETARY,0)."</td></tr>\n";
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].'><td width="300">=> price2num(1234.56)</td><td>'.price2num(1233.56+1,'2')."</td></tr>"; print "<tr ".$bc[$var].'><td width="300">=> price2num(1234.56)</td><td>'.price2num(1233.56+1,'2')."</td></tr>";
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].'><td width="300">=> dolibarr_print_date(0,"dayhourtext")</td><td>'.dolibarr_print_date(0,"dayhourtext")."</td>"; print "<tr ".$bc[$var].'><td width="300">=> dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0,"dayhourtext")."</td>";
// Thousands // Thousands
$var=!$var; $var=!$var;
$thousand=$langs->trans("SeparatorThousand"); $thousand=$langs->trans("SeparatorThousand");

View File

@ -355,18 +355,18 @@ September=September
October=October October=October
November=November November=November
December=December December=December
Month01=jan Month01=january
Month02=feb Month02=february
Month03=mar Month03=march
Month04=apr Month04=april
Month05=may Month05=may
Month06=jun Month06=june
Month07=jul Month07=july
Month08=aug Month08=august
Month09=sep Month09=september
Month10=oct Month10=october
Month11=nov Month11=november
Month12=dec Month12=december
MonthShort01=jan MonthShort01=jan
MonthShort02=feb MonthShort02=feb
MonthShort03=mar MonthShort03=mar

View File

@ -380,8 +380,7 @@ function dolibarr_print_date($time,$format='',$to_gmt=false,$outputlangs='')
* "%d/%m/%Y %H:%M:%S", * "%d/%m/%Y %H:%M:%S",
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext" * "day", "daytext", "dayhour", "dayhourldap", "dayhourtext"
* \param to_gmt false=output string if for local server TZ users, true=output string is for GMT users * \param to_gmt false=output string if for local server TZ users, true=output string is for GMT users
* \param outputlangs Object lang that contains charset_output property to define output * \param outputlangs Object lang that contains language for text translation.
* This means output is encoded in UTF-8 in default case.
* \return string Formated date or '' if time is null * \return string Formated date or '' if time is null
*/ */
function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='') function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='')
@ -442,12 +441,6 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='')
else $ret='Bad value '.$time.' for date'; else $ret='Bad value '.$time.' for date';
} }
// What is page code of texts from strftime functions ?
// $pagecodefrom='ISO-8859-1';
// $localtime=setlocale(LC_TIME,0);
//print $localtime;
// if (eregi('UTF',$localtime)) $pagecodefrom='UTF-8';
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
if (eregi('__b__',$format)) if (eregi('__b__',$format))
@ -463,7 +456,6 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='')
//return $ret; //return $ret;
} }
// return $outputlangs->convToOutputCharset($ret,$pagecodefrom);
return $ret; return $ret;
} }

View File

@ -153,8 +153,6 @@ class Translate {
if (defined("MAIN_FORCE_SETLOCALE_LC_ALL") && MAIN_FORCE_SETLOCALE_LC_ALL) if (defined("MAIN_FORCE_SETLOCALE_LC_ALL") && MAIN_FORCE_SETLOCALE_LC_ALL)
$res_lc_all=setlocale(LC_ALL, MAIN_FORCE_SETLOCALE_LC_ALL.'.UTF-8', MAIN_FORCE_SETLOCALE_LC_ALL); $res_lc_all=setlocale(LC_ALL, MAIN_FORCE_SETLOCALE_LC_ALL.'.UTF-8', MAIN_FORCE_SETLOCALE_LC_ALL);
if (defined("MAIN_FORCE_SETLOCALE_LC_TIME") && MAIN_FORCE_SETLOCALE_LC_TIME)
$res_lc_time=setlocale(LC_TIME, MAIN_FORCE_SETLOCALE_LC_TIME.'.UTF-8', MAIN_FORCE_SETLOCALE_LC_TIME);
if (defined("MAIN_FORCE_SETLOCALE_LC_NUMERIC") && MAIN_FORCE_SETLOCALE_LC_NUMERIC) if (defined("MAIN_FORCE_SETLOCALE_LC_NUMERIC") && MAIN_FORCE_SETLOCALE_LC_NUMERIC)
$res_lc_numeric=setlocale(LC_NUMERIC, MAIN_FORCE_SETLOCALE_LC_NUMERIC.'.UTF-8', MAIN_FORCE_SETLOCALE_LC_NUMERIC); $res_lc_numeric=setlocale(LC_NUMERIC, MAIN_FORCE_SETLOCALE_LC_NUMERIC.'.UTF-8', MAIN_FORCE_SETLOCALE_LC_NUMERIC);
if (defined("MAIN_FORCE_SETLOCALE_LC_MONETARY") && MAIN_FORCE_SETLOCALE_LC_MONETARY) if (defined("MAIN_FORCE_SETLOCALE_LC_MONETARY") && MAIN_FORCE_SETLOCALE_LC_MONETARY)

View File

@ -196,7 +196,6 @@ insert into llx_const (name, value, type, visible) values ('FACTURE_ADDON_PDF',
-- Forcer les locales -- Forcer les locales
-- --
insert into llx_const (name, value, type, visible, note) VALUES ('MAIN_FORCE_SETLOCALE_LC_ALL', '', 'chaine', 1, 'Pour forcer LC_ALL si pb de locale'); insert into llx_const (name, value, type, visible, note) VALUES ('MAIN_FORCE_SETLOCALE_LC_ALL', '', 'chaine', 1, 'Pour forcer LC_ALL si pb de locale');
insert into llx_const (name, value, type, visible, note) VALUES ('MAIN_FORCE_SETLOCALE_LC_TIME', '', 'chaine', 1, 'Pour forcer LC_TIME si pb de locale');
insert into llx_const (name, value, type, visible, note) VALUES ('MAIN_FORCE_SETLOCALE_LC_MONETARY', '', 'chaine', 1, 'Pour forcer LC_MONETARY si pb de locale'); insert into llx_const (name, value, type, visible, note) VALUES ('MAIN_FORCE_SETLOCALE_LC_MONETARY', '', 'chaine', 1, 'Pour forcer LC_MONETARY si pb de locale');
insert into llx_const (name, value, type, visible, note) VALUES ('MAIN_FORCE_SETLOCALE_LC_NUMERIC', '', 'chaine', 1, 'Mettre la valeur C si problème de centimes'); insert into llx_const (name, value, type, visible, note) VALUES ('MAIN_FORCE_SETLOCALE_LC_NUMERIC', '', 'chaine', 1, 'Mettre la valeur C si problème de centimes');