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
9f0c0bfc
Commit
9f0c0bfc
authored
9 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
NEW Introduce hidden option MAIN_REPLACE_TRANS_xx_XX to allow simple
replacement of translated string on the fly.
parent
a84ec64e
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
+14
-1
14 additions, 1 deletion
htdocs/core/class/translate.class.php
with
14 additions
and
1 deletion
htdocs/core/class/translate.class.php
+
14
−
1
View file @
9f0c0bfc
<?php
/* Copyright (C) 2001 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-201
2
Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2004-201
5
Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -579,6 +579,19 @@ 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
{
// Overwrite translation with param MAIN_OVERWRITE_TRANS_xx_XX
$tmparray
=
explode
(
';'
,
$conf
->
global
->
$replacekey
);
foreach
(
$tmparray
as
$tmp
)
{
$tmparray2
=
explode
(
':'
,
$tmp
);
$str
=
preg_replace
(
'/'
.
preg_quote
(
$tmparray2
[
0
])
.
'/'
,
$tmparray2
[
1
],
$str
);
}
}
if
(
!
preg_match
(
'/^Format/'
,
$key
))
{
//print $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