Skip to content
Snippets Groups Projects
Commit 9b32e07e authored by Tim Hunt's avatar Tim Hunt
Browse files

Improve maxima_latex_tidy caching in case a script processes two languages

parent 4c3b5e71
No related branches found
No related tags found
No related merge requests found
......@@ -56,9 +56,12 @@ function stack_string($key, $a = null) {
* @return array search => replace strings.
*/
function get_stack_maxima_latex_replacements() {
static $replacements = null;
if ($replacements === null) {
$replacements = [
// This is an array language code => replacements array.
static $replacements = [];
$lang = current_language();
if (!isset($replacements[$lang])) {
$replacements[$lang] = [
'QMCHAR' => '?',
'!LEFTSQ!' => '\left[',
'!LEFTR!' => '\left(',
......@@ -75,7 +78,7 @@ function get_stack_maxima_latex_replacements() {
'!NOT!' => stack_string('equiv_NOT'),
];
}
return $replacements;
return $replacements[$lang];
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment