diff --git a/ChangeLog b/ChangeLog index 9eb4dd2051953bdb6173d12a88a34b58210927b8..08d53ea7cdb4a4440fc159a086f4850806cf1809 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,7 +37,7 @@ For users: Use accesskey on form search. - New: Intervention documents are now available in ECM module - New: Add attachments on user card + in ECM module -- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template. +- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template. - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem @@ -59,6 +59,7 @@ For users: For translators: - Update language files. +- New: When a translation is not available we always jump to en_US and only en_US. For developers: - New: getBrowserInfo can return type of layout (classic/phone/tablet) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 3657cca03f5417115b19f605c11e7d7d3fe91339..383ac4a035dedc426aeabb2b234443c2d2663d0e 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -154,7 +154,7 @@ class Translate * If $domain is "file@module" instead of "file" then we look for module lang file * in htdocs/custom/modules/mymodule/langs/code_CODE/file.lang * then in htdocs/module/langs/code_CODE/file.lang instead of htdocs/langs/code_CODE/file.lang - * @param string $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US or fr_FR or es_ES) + * @param string $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US) * @param int $stopafterdirection Stop when the DIRECTION tag is found (optimize speed) * @param int $forcelangdir To force a different lang directory * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK @@ -196,7 +196,7 @@ class Translate // Redefine alt $langarray=explode('_',$langofdir); if ($alt < 1 && isset($langarray[1]) && strtolower($langarray[0]) == strtolower($langarray[1])) $alt=1; - if ($alt < 2 && (strtolower($langofdir) == 'en_us' || strtolower($langofdir) == 'fr_fr' || strtolower($langofdir) == 'es_es')) $alt=2; + if ($alt < 2 && strtolower($langofdir) == 'en_us') $alt=2; foreach($this->dir as $keydir => $searchdir) { @@ -312,8 +312,8 @@ class Translate // This function MUST NOT contains call to syslog //dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$newdomain.".lang file)", LOG_DEBUG); $langofdir='en_US'; - if (preg_match('/^fr/i',$langarray[0])) $langofdir='fr_FR'; - if (preg_match('/^es/i',$langarray[0])) $langofdir='es_ES'; + //if (preg_match('/^fr/i',$langarray[0])) $langofdir='fr_FR'; + //if (preg_match('/^es/i',$langarray[0])) $langofdir='es_ES'; $this->load($domain,$alt+1,$stopafterdirection,$langofdir); } @@ -592,7 +592,7 @@ class Translate { // Test si fichier dans repertoire de la langue alternative if ($this->defaultlang != "en_US") $filenamealt = $searchdir."/langs/en_US/".$filename; - else $filenamealt = $searchdir."/langs/fr_FR/".$filename; + //else $filenamealt = $searchdir."/langs/fr_FR/".$filename; if (is_readable(dol_osencode($filenamealt))) return true; } }