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
18725b55
Commit
18725b55
authored
9 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Option MAIN_REPLACE_TRANS_xx_XX is now completely implemented.
parent
dcf7d344
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/core/class/translate.class.php
+10
-16
10 additions, 16 deletions
htdocs/core/class/translate.class.php
with
10 additions
and
16 deletions
htdocs/core/class/translate.class.php
+
10
−
16
View file @
18725b55
...
...
@@ -580,10 +580,9 @@ class Translate
$str
=
$this
->
tab_translate
[
$key
];
// Make some string replacement after translation
$replacekey
=
'MAIN_REPLACE_TRANS_'
.
$this
->
defaultlang
;
if
(
!
empty
(
$conf
->
global
->
$replacekey
))
// Replacement translation variable with string1:newstring1
,
string2:newstring2
$replacekey
=
'MAIN_REPLACE_TRANS_'
.
$this
->
defaultlang
;
if
(
!
empty
(
$conf
->
global
->
$replacekey
))
// Replacement translation variable with string1:newstring1
;
string2:newstring2
{
// Overwrite translation with param MAIN_OVERWRITE_TRANS_xx_XX
$tmparray
=
explode
(
';'
,
$conf
->
global
->
$replacekey
);
foreach
(
$tmparray
as
$tmp
)
{
...
...
@@ -660,17 +659,17 @@ class Translate
{
$str
=
$this
->
tab_translate
[
$key
];
//
Overwri
te translation
$overwrit
ekey
=
'MAIN_
OVERWRIT
E_TRANS_'
.
$this
->
defaultlang
;
if
(
!
empty
(
$conf
->
global
->
$
overwrit
ekey
))
//
Overwrite
translation
with key
1:newstring1
,key
2:newstring2
//
Make some string replacement af
te
r
translation
$replac
ekey
=
'MAIN_
REPLAC
E_TRANS_'
.
$this
->
defaultlang
;
if
(
!
empty
(
$conf
->
global
->
$
replac
ekey
))
//
Replacement
translation
variable with string
1:newstring1
;string
2:newstring2
{
$tmparray
=
explode
(
'
,
'
,
$conf
->
global
->
$
overwrit
ekey
);
$tmparray
=
explode
(
'
;
'
,
$conf
->
global
->
$
replac
ekey
);
foreach
(
$tmparray
as
$tmp
)
{
$tmparray2
=
explode
(
':'
,
$tmp
);
if
(
$tmparray2
[
0
]
==
$key
)
{
$str
=
$tmparray2
[
1
]
;
break
;
}
$str
=
preg_replace
(
'/'
.
preg_quote
(
$tmparray2
[
0
])
.
'/'
,
$tmparray2
[
1
]
,
$str
);
}
}
}
if
(
!
preg_match
(
'/^Format/'
,
$key
))
{
...
...
@@ -982,7 +981,8 @@ class Translate
}
/**
* Return an array with content of all loaded translation keys (found into this->tab_translate)
* Return an array with content of all loaded translation keys (found into this->tab_translate) so
* we get a substitution array we can use for substitutions (for mail or ODT generation for example)
*
* @return array Array of translation keys lang_key => string_translation_loaded
*/
...
...
@@ -997,9 +997,3 @@ class Translate
return
$substitutionarray
;
}
}
function
warning_handler
(
$errno
,
$errstr
,
$errfile
,
$errline
,
array
$errcontext
)
{
global
$str
;
print
'str='
.
$str
;
}
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