forked from Wavyzz/dolibarr
Fix: Translation of days
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -324,7 +324,7 @@ if ($showbirthday)
|
|||||||
// Sort on date
|
// Sort on date
|
||||||
$sql .= ' ORDER BY birthday';
|
$sql .= ' ORDER BY birthday';
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@@ -343,17 +343,17 @@ if ($showbirthday)
|
|||||||
$action->type_code='BIRTHDAY';
|
$action->type_code='BIRTHDAY';
|
||||||
$action->libelle=$langs->trans("Birthday").' '.$obj->firstname.' '.$obj->name;
|
$action->libelle=$langs->trans("Birthday").' '.$obj->firstname.' '.$obj->name;
|
||||||
$action->percentage=100;
|
$action->percentage=100;
|
||||||
|
|
||||||
$action->date_start_in_calendar=$action->datep;
|
$action->date_start_in_calendar=$action->datep;
|
||||||
$action->date_end_in_calendar=$action->datef;
|
$action->date_end_in_calendar=$action->datef;
|
||||||
$action->ponctuel=0;
|
$action->ponctuel=0;
|
||||||
|
|
||||||
// Add an entry in actionarray for each day
|
// Add an entry in actionarray for each day
|
||||||
$daycursor=$action->date_start_in_calendar;
|
$daycursor=$action->date_start_in_calendar;
|
||||||
$annee = date('Y',$daycursor);
|
$annee = date('Y',$daycursor);
|
||||||
$mois = date('m',$daycursor);
|
$mois = date('m',$daycursor);
|
||||||
$jour = date('d',$daycursor);
|
$jour = date('d',$daycursor);
|
||||||
|
|
||||||
$loop=true;
|
$loop=true;
|
||||||
$daykey=dol_mktime(0,0,0,$mois,$jour,$annee);
|
$daykey=dol_mktime(0,0,0,$mois,$jour,$annee);
|
||||||
do
|
do
|
||||||
@@ -396,15 +396,15 @@ if ($_GET["action"] != 'show_day')
|
|||||||
{
|
{
|
||||||
echo '<table width="100%" class="nocellnopadd">';
|
echo '<table width="100%" class="nocellnopadd">';
|
||||||
echo ' <tr class="liste_titre">';
|
echo ' <tr class="liste_titre">';
|
||||||
echo ' <td align="center">'.$langs->trans("Monday")."</td>\n";
|
echo ' <td align="center">'.$langs->trans("Day1")."</td>\n";
|
||||||
echo ' <td align="center">'.$langs->trans("Tuesday")."</td>\n";
|
echo ' <td align="center">'.$langs->trans("Day2")."</td>\n";
|
||||||
echo ' <td align="center">'.$langs->trans("Wednesday")."</td>\n";
|
echo ' <td align="center">'.$langs->trans("Day3")."</td>\n";
|
||||||
echo ' <td align="center">'.$langs->trans("Thursday")."</td>\n";
|
echo ' <td align="center">'.$langs->trans("Day4")."</td>\n";
|
||||||
echo ' <td align="center">'.$langs->trans("Friday")."</td>\n";
|
echo ' <td align="center">'.$langs->trans("Day5")."</td>\n";
|
||||||
echo ' <td align="center">'.$langs->trans("Saturday")."</td>\n";
|
echo ' <td align="center">'.$langs->trans("Day6")."</td>\n";
|
||||||
echo ' <td align="center">'.$langs->trans("Sunday")."</td>\n";
|
echo ' <td align="center">'.$langs->trans("Day0")."</td>\n";
|
||||||
echo " </tr>\n";
|
echo " </tr>\n";
|
||||||
|
|
||||||
// In loops, tmpday contains day nb in current month (can be negative for days of previous month)
|
// In loops, tmpday contains day nb in current month (can be negative for days of previous month)
|
||||||
for($iter_week = 0; $iter_week < 6 ; $iter_week++)
|
for($iter_week = 0; $iter_week < 6 ; $iter_week++)
|
||||||
{
|
{
|
||||||
@@ -456,7 +456,13 @@ else
|
|||||||
$style='cal_current_month';
|
$style='cal_current_month';
|
||||||
$timestamp=dol_mktime(12,0,0,$month,$_GET["day"],$year);
|
$timestamp=dol_mktime(12,0,0,$month,$_GET["day"],$year);
|
||||||
$arraytimestamp=adodb_getdate(dol_mktime(12,0,0,$month,$_GET["day"],$year));
|
$arraytimestamp=adodb_getdate(dol_mktime(12,0,0,$month,$_GET["day"],$year));
|
||||||
$dayname=array('0'=>'Sunday','1'=>'Monday','2'=>'Tuesday','3'=>'Wednesday','4'=>'Thursday','5'=>'Friday','6'=>'Saturday');
|
$dayname=array( '0'=>'Sunday',
|
||||||
|
'1'=>'Monday',
|
||||||
|
'2'=>'Tuesday',
|
||||||
|
'3'=>'Wednesday',
|
||||||
|
'4'=>'Thursday',
|
||||||
|
'5'=>'Friday',
|
||||||
|
'6'=>'Saturday');
|
||||||
echo '<table width="100%" class="nocellnopadd">';
|
echo '<table width="100%" class="nocellnopadd">';
|
||||||
echo ' <tr class="liste_titre">';
|
echo ' <tr class="liste_titre">';
|
||||||
echo ' <td align="center">'.$langs->trans($dayname[$arraytimestamp['wday']])."</td>\n";
|
echo ' <td align="center">'.$langs->trans($dayname[$arraytimestamp['wday']])."</td>\n";
|
||||||
@@ -511,7 +517,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
|
|||||||
|
|
||||||
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
|
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|
||||||
foreach ($actionarray as $daykey => $notused)
|
foreach ($actionarray as $daykey => $notused)
|
||||||
{
|
{
|
||||||
$annee = date('Y',$daykey);
|
$annee = date('Y',$daykey);
|
||||||
@@ -532,7 +538,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
|
|||||||
//print "x".$color;
|
//print "x".$color;
|
||||||
print '<table class="cal_event" style="background: #'.$color.'; -moz-border-radius:4px; " width="100%"><tr>';
|
print '<table class="cal_event" style="background: #'.$color.'; -moz-border-radius:4px; " width="100%"><tr>';
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
if ($action->type_code != 'BIRTHDAY')
|
if ($action->type_code != 'BIRTHDAY')
|
||||||
{
|
{
|
||||||
$tmpyearstart = date('Y',$action->date_start_in_calendar);
|
$tmpyearstart = date('Y',$action->date_start_in_calendar);
|
||||||
$tmpmonthstart = date('m',$action->date_start_in_calendar);
|
$tmpmonthstart = date('m',$action->date_start_in_calendar);
|
||||||
@@ -582,7 +588,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=maxPrint&month='.$month.'&year='.$year.'">'.img_picto("all","1downarrow_selected.png").' ...';
|
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=maxPrint&month='.$month.'&year='.$year.'">'.img_picto("all","1downarrow_selected.png").' ...';
|
||||||
print ' +'.(sizeof($actionarray[$daykey])-$maxPrint);
|
print ' +'.(sizeof($actionarray[$daykey])-$maxPrint);
|
||||||
print '</a>';
|
print '</a>';
|
||||||
break;
|
break;
|
||||||
//$ok=false; // To avoid to show twice the link
|
//$ok=false; // To avoid to show twice the link
|
||||||
|
|||||||
@@ -500,13 +500,13 @@ Informations = Informació
|
|||||||
Page = Pàgina
|
Page = Pàgina
|
||||||
Notes = Notes
|
Notes = Notes
|
||||||
# Week day = =
|
# Week day = =
|
||||||
Monday = Dillus
|
Day1 = Dillus
|
||||||
Tuesday = Dimarts
|
Day2 = Dimarts
|
||||||
Wednesday = Dimecres
|
Day3 = Dimecres
|
||||||
Thursday = Dijous
|
Day4 = Dijous
|
||||||
Friday = Divendres
|
Day5 = Divendres
|
||||||
Saturday = Dissabte
|
Day6 = Dissabte
|
||||||
Sunday = Diumenge
|
Day0 = Diumenge
|
||||||
ShortMonday = Dl
|
ShortMonday = Dl
|
||||||
ShortTuesday = Dm
|
ShortTuesday = Dm
|
||||||
ShortWednesday = Dx
|
ShortWednesday = Dx
|
||||||
|
|||||||
@@ -501,13 +501,13 @@ Informations=Informations
|
|||||||
Page=Page
|
Page=Page
|
||||||
Notes=Notes
|
Notes=Notes
|
||||||
# Week day
|
# Week day
|
||||||
Monday=Monday
|
Day1=Monday
|
||||||
Tuesday=Tuesday
|
Day2=Tuesday
|
||||||
Wednesday=Wednesday
|
Day3=Wednesday
|
||||||
Thursday=Thursday
|
Day4=Thursday
|
||||||
Friday=Friday
|
Day5=Friday
|
||||||
Saturday=Saturday
|
Day6=Saturday
|
||||||
Sunday=Sunday
|
Day0=Sunday
|
||||||
ShortMonday=M
|
ShortMonday=M
|
||||||
ShortTuesday=T
|
ShortTuesday=T
|
||||||
ShortWednesday=W
|
ShortWednesday=W
|
||||||
|
|||||||
@@ -500,13 +500,13 @@ Informations = Información
|
|||||||
Page = Página
|
Page = Página
|
||||||
Notes = Notas
|
Notes = Notas
|
||||||
# Week day =
|
# Week day =
|
||||||
Monday = Lunes
|
Day1 = Lunes
|
||||||
Tuesday = Martes
|
Day2 = Martes
|
||||||
Wednesday = Miercoles
|
Day3 = Miercoles
|
||||||
Thursday = Jueves
|
Day4 = Jueves
|
||||||
Friday = Viernes
|
Day5 = Viernes
|
||||||
Saturday = Sábado
|
Day6 = Sábado
|
||||||
Sunday = Domingo
|
Day0 = Domingo
|
||||||
ShortMonday = L
|
ShortMonday = L
|
||||||
ShortTuesday = Ma
|
ShortTuesday = Ma
|
||||||
ShortWednesday = M
|
ShortWednesday = M
|
||||||
|
|||||||
@@ -500,13 +500,13 @@ Informations=Informations
|
|||||||
Page=Page
|
Page=Page
|
||||||
Notes=Notes
|
Notes=Notes
|
||||||
# Week day
|
# Week day
|
||||||
Monday=Lundi
|
Day1=Lundi
|
||||||
Tuesday=Mardi
|
Day2=Mardi
|
||||||
Wednesday=Mercredi
|
Day3=Mercredi
|
||||||
Thursday=Jeudi
|
Day4=Jeudi
|
||||||
Friday=Vendredi
|
Day5=Vendredi
|
||||||
Saturday=Samedi
|
Day6=Samedi
|
||||||
Sunday=Dimanche
|
Day0=Dimanche
|
||||||
ShortMonday=L
|
ShortMonday=L
|
||||||
ShortTuesday=M
|
ShortTuesday=M
|
||||||
ShortWednesday=M
|
ShortWednesday=M
|
||||||
|
|||||||
@@ -374,6 +374,12 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='',$encodeto
|
|||||||
$format=ereg_replace('%b','__b__',$format);
|
$format=ereg_replace('%b','__b__',$format);
|
||||||
$format=ereg_replace('%B','__B__',$format);
|
$format=ereg_replace('%B','__B__',$format);
|
||||||
}
|
}
|
||||||
|
if (eregi('%a',$format)) // There is some text to translate
|
||||||
|
{
|
||||||
|
// We inhibate translation to text made by strftime functions. We will use trans instead later.
|
||||||
|
$format=ereg_replace('%a','__a__',$format);
|
||||||
|
$format=ereg_replace('%A','__A__',$format);
|
||||||
|
}
|
||||||
|
|
||||||
// Analyse de la date (deprecated) Ex: 19700101, 19700101010000
|
// Analyse de la date (deprecated) Ex: 19700101, 19700101010000
|
||||||
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?',$time,$reg)
|
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?',$time,$reg)
|
||||||
@@ -424,6 +430,13 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='',$encodeto
|
|||||||
//print 'x'.$outputlangs->charset_output.'-'.$ret.'x';
|
//print 'x'.$outputlangs->charset_output.'-'.$ret.'x';
|
||||||
//return $ret;
|
//return $ret;
|
||||||
}
|
}
|
||||||
|
if (eregi('__a__',$format))
|
||||||
|
{
|
||||||
|
$w=adodb_strftime('%w',$time);
|
||||||
|
$dayweek=$outputlangs->transnoentitiesnoconv('Day'.$w);
|
||||||
|
$ret=ereg_replace('__A__',$dayweek,$ret);
|
||||||
|
$ret=ereg_replace('__a__',dol_substr($dayweek,0,3),$ret);
|
||||||
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@@ -1520,8 +1533,8 @@ function dol_print_error($db='',$error='')
|
|||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/translate.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/translate.class.php");
|
||||||
$langs = new Translate("", $conf);
|
$langs = new Translate("", $conf);
|
||||||
|
$langs->load("main");
|
||||||
}
|
}
|
||||||
$langs->load("main");
|
|
||||||
|
|
||||||
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
|
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
|
||||||
{
|
{
|
||||||
@@ -1534,8 +1547,8 @@ function dol_print_error($db='',$error='')
|
|||||||
print "<b>".$langs->trans("Date").":</b> ".dol_print_date(time(),'dayhourlog')."<br>\n";;
|
print "<b>".$langs->trans("Date").":</b> ".dol_print_date(time(),'dayhourlog')."<br>\n";;
|
||||||
if (isset($conf->global->MAIN_FEATURES_LEVEL)) print "<b>".$langs->trans("LevelOfFeature").":</b> ".$conf->global->MAIN_FEATURES_LEVEL."<br>\n";;
|
if (isset($conf->global->MAIN_FEATURES_LEVEL)) print "<b>".$langs->trans("LevelOfFeature").":</b> ".$conf->global->MAIN_FEATURES_LEVEL."<br>\n";;
|
||||||
print "<b>".$langs->trans("Server").":</b> ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";;
|
print "<b>".$langs->trans("Server").":</b> ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";;
|
||||||
print "<b>".$langs->trans("RequestedUrl").":</b> ".$_SERVER["REQUEST_URI"]."<br>\n";;
|
|
||||||
print "<b>".$langs->trans("Referer").":</b> ".$_SERVER["HTTP_REFERER"]."<br>\n";;
|
print "<b>".$langs->trans("Referer").":</b> ".$_SERVER["HTTP_REFERER"]."<br>\n";;
|
||||||
|
print "<b>".$langs->trans("RequestedUrl").":</b> ".$_SERVER["REQUEST_URI"]."<br>\n";;
|
||||||
print "<b>".$langs->trans("MenuManager").":</b> ".$conf->left_menu.'/'.$conf->top_menu."<br>\n";
|
print "<b>".$langs->trans("MenuManager").":</b> ".$conf->left_menu.'/'.$conf->top_menu."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$syslog.="url=".$_SERVER["REQUEST_URI"];
|
$syslog.="url=".$_SERVER["REQUEST_URI"];
|
||||||
|
|||||||
@@ -284,8 +284,8 @@ class Translate {
|
|||||||
// Pour les langues aux fichiers parfois incomplets, on charge la langue alternative
|
// Pour les langues aux fichiers parfois incomplets, on charge la langue alternative
|
||||||
if (! $newalt && $this->defaultlang != "fr_FR" && $this->defaultlang != "en_US")
|
if (! $newalt && $this->defaultlang != "fr_FR" && $this->defaultlang != "en_US")
|
||||||
{
|
{
|
||||||
// This function must not contains call to syslog
|
// This function MUST NOY contains call to syslog
|
||||||
dol_print_error("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$domain.".lang file)", LOG_DEBUG);
|
//dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$domain.".lang file)", LOG_DEBUG);
|
||||||
$this->load($domain,1);
|
$this->load($domain,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user