Add a way to support parsing translations

This commit is contained in:
Kazhnuz 2025-09-11 10:25:11 +02:00
parent 329265c030
commit 6f359c5aea

View file

@ -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)