From 9b2a6f845ecb611684bb2cd36ef3b52664f3ad7c Mon Sep 17 00:00:00 2001 From: bergware Date: Sun, 5 Apr 2020 11:43:18 +0200 Subject: [PATCH] Multi-language support --- plugins/dynamix/include/Translations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dynamix/include/Translations.php b/plugins/dynamix/include/Translations.php index c8ea5e5a8..012a8a359 100644 --- a/plugins/dynamix/include/Translations.php +++ b/plugins/dynamix/include/Translations.php @@ -52,8 +52,8 @@ function my_lang($text,$do=0) { foreach ($keys as $key) if (isset($language[$key])) $text = preg_replace("/\b$key\b/",$language[$key],$text); break; case 3: // device translation - [$p1,$p2] = explode(' ',$text); - $text = rtrim(_($p1)." $p2"); + [$p1,$p2] = preg_split('/(?<=[a-z])(?= ?[0-9]+)/',$text); + $text = _($p1).$p2; } return $text; }