diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 27bcb64da3c..8235f99d129 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Destailleur Laurent + * Copyright (C) 2004-2015 Destailleur Laurent * Copyright (C) 2005-2010 Regis Houssin * * 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;