Skip to content
Snippets Groups Projects
Commit 4922071a authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: When a translation is not available we always jump to en_US and

only en_US.
parent 06fcbe12
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment