forked from Wavyzz/dolibarr
Fix: Translation of days
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* 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>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -396,13 +396,13 @@ if ($_GET["action"] != 'show_day')
|
||||
{
|
||||
echo '<table width="100%" class="nocellnopadd">';
|
||||
echo ' <tr class="liste_titre">';
|
||||
echo ' <td align="center">'.$langs->trans("Monday")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Tuesday")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Wednesday")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Thursday")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Friday")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Saturday")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Sunday")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Day1")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Day2")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Day3")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Day4")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Day5")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Day6")."</td>\n";
|
||||
echo ' <td align="center">'.$langs->trans("Day0")."</td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
// In loops, tmpday contains day nb in current month (can be negative for days of previous month)
|
||||
@@ -456,7 +456,13 @@ else
|
||||
$style='cal_current_month';
|
||||
$timestamp=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 ' <tr class="liste_titre">';
|
||||
echo ' <td align="center">'.$langs->trans($dayname[$arraytimestamp['wday']])."</td>\n";
|
||||
|
||||
@@ -500,13 +500,13 @@ Informations = Informació
|
||||
Page = Pàgina
|
||||
Notes = Notes
|
||||
# Week day = =
|
||||
Monday = Dillus
|
||||
Tuesday = Dimarts
|
||||
Wednesday = Dimecres
|
||||
Thursday = Dijous
|
||||
Friday = Divendres
|
||||
Saturday = Dissabte
|
||||
Sunday = Diumenge
|
||||
Day1 = Dillus
|
||||
Day2 = Dimarts
|
||||
Day3 = Dimecres
|
||||
Day4 = Dijous
|
||||
Day5 = Divendres
|
||||
Day6 = Dissabte
|
||||
Day0 = Diumenge
|
||||
ShortMonday = Dl
|
||||
ShortTuesday = Dm
|
||||
ShortWednesday = Dx
|
||||
|
||||
@@ -501,13 +501,13 @@ Informations=Informations
|
||||
Page=Page
|
||||
Notes=Notes
|
||||
# Week day
|
||||
Monday=Monday
|
||||
Tuesday=Tuesday
|
||||
Wednesday=Wednesday
|
||||
Thursday=Thursday
|
||||
Friday=Friday
|
||||
Saturday=Saturday
|
||||
Sunday=Sunday
|
||||
Day1=Monday
|
||||
Day2=Tuesday
|
||||
Day3=Wednesday
|
||||
Day4=Thursday
|
||||
Day5=Friday
|
||||
Day6=Saturday
|
||||
Day0=Sunday
|
||||
ShortMonday=M
|
||||
ShortTuesday=T
|
||||
ShortWednesday=W
|
||||
|
||||
@@ -500,13 +500,13 @@ Informations = Información
|
||||
Page = Página
|
||||
Notes = Notas
|
||||
# Week day =
|
||||
Monday = Lunes
|
||||
Tuesday = Martes
|
||||
Wednesday = Miercoles
|
||||
Thursday = Jueves
|
||||
Friday = Viernes
|
||||
Saturday = Sábado
|
||||
Sunday = Domingo
|
||||
Day1 = Lunes
|
||||
Day2 = Martes
|
||||
Day3 = Miercoles
|
||||
Day4 = Jueves
|
||||
Day5 = Viernes
|
||||
Day6 = Sábado
|
||||
Day0 = Domingo
|
||||
ShortMonday = L
|
||||
ShortTuesday = Ma
|
||||
ShortWednesday = M
|
||||
|
||||
@@ -500,13 +500,13 @@ Informations=Informations
|
||||
Page=Page
|
||||
Notes=Notes
|
||||
# Week day
|
||||
Monday=Lundi
|
||||
Tuesday=Mardi
|
||||
Wednesday=Mercredi
|
||||
Thursday=Jeudi
|
||||
Friday=Vendredi
|
||||
Saturday=Samedi
|
||||
Sunday=Dimanche
|
||||
Day1=Lundi
|
||||
Day2=Mardi
|
||||
Day3=Mercredi
|
||||
Day4=Jeudi
|
||||
Day5=Vendredi
|
||||
Day6=Samedi
|
||||
Day0=Dimanche
|
||||
ShortMonday=L
|
||||
ShortTuesday=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);
|
||||
}
|
||||
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
|
||||
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';
|
||||
//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;
|
||||
}
|
||||
@@ -1520,8 +1533,8 @@ function dol_print_error($db='',$error='')
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT ."/translate.class.php");
|
||||
$langs = new Translate("", $conf);
|
||||
}
|
||||
$langs->load("main");
|
||||
}
|
||||
|
||||
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";;
|
||||
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("RequestedUrl").":</b> ".$_SERVER["REQUEST_URI"]."<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 "<br>\n";
|
||||
$syslog.="url=".$_SERVER["REQUEST_URI"];
|
||||
|
||||
@@ -284,8 +284,8 @@ class Translate {
|
||||
// Pour les langues aux fichiers parfois incomplets, on charge la langue alternative
|
||||
if (! $newalt && $this->defaultlang != "fr_FR" && $this->defaultlang != "en_US")
|
||||
{
|
||||
// This function must not contains call to syslog
|
||||
dol_print_error("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$domain.".lang file)", LOG_DEBUG);
|
||||
// This function MUST NOY contains call to syslog
|
||||
//dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$domain.".lang file)", LOG_DEBUG);
|
||||
$this->load($domain,1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user