From 2103ad0c665d2e00a519554aa919afe2919a741c Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 9 Mar 2022 11:21:00 +0100 Subject: [PATCH] MOBILE-3153 lang: Remove placeholders from strings This is necessary because we started using strings with placeholders that the app doesn't interpret, in particular the ones in user tours: https://github.com/moodle/moodle/blob/7ff6b2daef613b5c1ee73fa25b394288a82f6d4e/admin%2Ftool%2Fusertours%2Flang%2Fen%2Ftool_usertours.php#L274 --- scripts/lang_functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/lang_functions.php b/scripts/lang_functions.php index 38bd83b72..a6698560c 100644 --- a/scripts/lang_functions.php +++ b/scripts/lang_functions.php @@ -257,6 +257,7 @@ function build_lang($lang, $keys) { $text = str_replace('$a->', '$a.', $text); $text = str_replace('{$a', '{{$a', $text); $text = str_replace('}', '}}', $text); + $text = preg_replace('/@@.+?@@(
)?\\s*/', '', $text); // Prevent double. $text = str_replace(array('{{{', '}}}'), array('{{', '}}'), $text); } else {