From 6f359c5aea9b2cd2489b471adaba3136f6679379 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 11 Sep 2025 10:25:11 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20a=20way=20to=20support=20pars?= =?UTF-8?q?ing=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bl-kernel/language.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bl-kernel/language.class.php b/bl-kernel/language.class.php index 9df427e4..209db5b7 100644 --- a/bl-kernel/language.class.php +++ b/bl-kernel/language.class.php @@ -104,6 +104,15 @@ class Language extends dbJSON { echo $this->get($string); } + public function parse($string, $replacements) + { + $str = $this->get($string); + foreach ($replacements as $key => $value) { + $str = str_replace("%".$key."%", $value, $str); + } + return $str; + } + // Add keys=>values to the current dicionary // This method don't overwrite the current value public function add($array)