From 19706705965ffa40799f1e2ca6c061f00eff74b6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 12 May 2015 17:06:47 -0700 Subject: 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. --- include/language.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/language.php b/include/language.php index 1e8528dc1..0af72142f 100644 --- a/include/language.php +++ b/include/language.php @@ -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 * -- cgit v1.2.3