New: If translation of currenci not availbale, go into database (with a cache)
This commit is contained in:
parent
ed7772a673
commit
7193bef29d
@ -10,7 +10,7 @@ AppVerName=DoliWamp 2.4
|
||||
OutputBaseFilename=DoliWamp 2.4
|
||||
; Define full path from wich all relative path are defined
|
||||
; You must modify this to put here your dolibarr root directory
|
||||
SourceDir=C:\Work\Applis\WampServer\wamp\www\dolibarr_new\dolibarr
|
||||
SourceDir=E:\Mes Developpements\dolibarr
|
||||
; ----- End of change
|
||||
AppId=doliwamp
|
||||
AppPublisher=Laurent Destailleur - NLTechno
|
||||
@ -54,14 +54,11 @@ Source: "build\exe\doliwamp\rundoliwamp.bat.install"; DestDir: "{app}\"; Flags:
|
||||
Source: "build\exe\doliwamp\install_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\uninstall_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
|
||||
Source: "build\exe\doliwamp\mysqlinitpassword.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
|
||||
; PhpMyAdmin
|
||||
Source: "..\..\..\apps\phpmyadmin2.10.1\*.*"; DestDir: "{app}\apps\phpmyadmin2.10.1"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf"
|
||||
; Apache
|
||||
Source: "..\..\..\bin\apache\apache2.2.6\*.*"; DestDir: "{app}\bin\apache\apache2.2.6"; Flags: ignoreversion recursesubdirs; Excludes: "httpd.conf,wampserver.conf"
|
||||
; Php
|
||||
Source: "..\..\..\bin\php\php5.2.5\*.*"; DestDir: "{app}\bin\php\php5.2.5"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,wampserver.conf"
|
||||
; Mysql
|
||||
Source: "..\..\..\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf"
|
||||
; PhpMyAdmin, Apache, Php, Mysql
|
||||
Source: "C:\Program Files\Wamp\apps\phpmyadmin2.10.1\*.*"; DestDir: "{app}\apps\phpmyadmin2.10.1"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\Program Files\Wamp\bin\apache\apache2.2.6\*.*"; DestDir: "{app}\bin\apache\apache2.2.6"; Flags: ignoreversion recursesubdirs; Excludes: "httpd.conf,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\Program Files\Wamp\bin\php\php5.2.5\*.*"; DestDir: "{app}\bin\php\php5.2.5"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,wampserver.conf,*.log,*_log"
|
||||
Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log"
|
||||
; Mysql database
|
||||
Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\mysql5.0.45\data\mysql"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db"
|
||||
; Dolibarr
|
||||
|
||||
@ -1124,7 +1124,7 @@ class Form
|
||||
if ($objp->fprice != '')
|
||||
{
|
||||
$opt.= price($objp->fprice);
|
||||
$opt.= $langs->trans("Currency".$conf->monnaie)."/".$objp->quantity;
|
||||
$opt.= $langs->trans("CurrencyShort".$conf->monnaie)."/".$objp->quantity;
|
||||
if ($objp->quantity == 1)
|
||||
{
|
||||
$opt.= strtolower($langs->trans("Unit"));
|
||||
@ -1136,7 +1136,7 @@ class Form
|
||||
if ($objp->quantity > 1)
|
||||
{
|
||||
$opt.=" - ";
|
||||
$opt.= price($objp->unitprice).$langs->trans("Currency".$conf->monnaie)."/".strtolower($langs->trans("Unit"));
|
||||
$opt.= price($objp->unitprice).$langs->trans("CurrencyShort".$conf->monnaie)."/".strtolower($langs->trans("Unit"));
|
||||
}
|
||||
if ($objp->duration) $opt .= " - ".$objp->duration;
|
||||
}
|
||||
|
||||
@ -271,10 +271,10 @@ class Translate {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne la version traduite du texte pass<EFBFBD> en param<EFBFBD>tre en la codant en HTML
|
||||
* \brief Retourne la version traduite du texte passe en parametre en la codant en HTML
|
||||
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
||||
* et si toujours pas trouv<EFBFBD>, il est retourn<EFBFBD> tel quel
|
||||
* Les param<EFBFBD>tres de cette m<EFBFBD>thode peuvent contenir de balises HTML.
|
||||
* et si toujours pas trouve, il est retourne tel quel
|
||||
* Les parametres de cette methode peuvent contenir de balises HTML.
|
||||
* \param key cl<EFBFBD> de chaine a traduire
|
||||
* \param param1 chaine de param1
|
||||
* \param param2 chaine de param2
|
||||
@ -287,7 +287,7 @@ class Translate {
|
||||
{
|
||||
if ($this->getTransFromTab($key))
|
||||
{
|
||||
// Si la traduction est disponible
|
||||
// Translation is available
|
||||
$str=sprintf($this->tab_translate[$key],$param1,$param2,$param3,$param4);
|
||||
if ($maxsize) $str=dolibarr_trunc($str,$maxsize);
|
||||
// On remplace les tags HTML par __xx__ pour eviter traduction par htmlentities
|
||||
@ -309,6 +309,10 @@ class Translate {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Translation is not available
|
||||
global $db;
|
||||
if (ereg('CurrencyShort([A-Z]+)$',$key,$reg)) $key=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','code');
|
||||
if (ereg('Currency([A-Z]+)$',$key,$reg)) $key=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','label');
|
||||
return $this->convToOuptutCharset($key);
|
||||
}
|
||||
}
|
||||
@ -467,8 +471,7 @@ class Translate {
|
||||
$sql = "SELECT ".$fieldlabel." as label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$tablename;
|
||||
$sql.= " WHERE ".$fieldkey." = '".$key."'";
|
||||
|
||||
dolibarr_syslog('Translate::getLabelFromKey ',LOG_DEBUG);
|
||||
dolibarr_syslog('Translate::getLabelFromKey sql='.$sql,LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user