Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
4922071a
Commit
4922071a
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
New: When a translation is not available we always jump to en_US and
only en_US.
parent
06fcbe12
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+2
-1
2 additions, 1 deletion
ChangeLog
htdocs/core/class/translate.class.php
+5
-5
5 additions, 5 deletions
htdocs/core/class/translate.class.php
with
7 additions
and
6 deletions
ChangeLog
+
2
−
1
View file @
4922071a
...
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/class/translate.class.php
+
5
−
5
View file @
4922071a
...
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment