replace project name with $product or $Product in strings to avoid merge issues across different project names. Currently a place-holder. The strings themselves have not yet been modified.

This commit is contained in:
redmatrix 2015-05-12 17:06:47 -07:00
parent 5dcdb676fd
commit 1970670596

View File

@ -159,12 +159,25 @@ function t($s, $ctx = '') {
if (x($a->strings, $cs)) {
$t = $a->strings[$cs];
return is_array($t) ? $t[0] : $t;
return ((is_array($t)) ? translate_product($t[0]) : translate_product($t));
}
return $s;
return translate_product($s);
}
/**
* @brief translate product name
* Merging strings from different project names is problematic so we'll do that with a string replacement
*/
function translate_product($s) {
return str_replace(array('$product','$Product'),array(RED_PLATFORM,ucfirst(RED_PLATFORM)),$s);
}
/**
* @brief
*