diff --git a/includes/components/locstring.class.php b/includes/components/locstring.class.php index 53da1fc9..2bfec006 100644 --- a/includes/components/locstring.class.php +++ b/includes/components/locstring.class.php @@ -6,7 +6,7 @@ if (!defined('AOWOW_REVISION')) die('illegal access'); -class LocString +class LocString implements \JsonSerializable { private \WeakMap $store; @@ -24,6 +24,11 @@ class LocString $this->store[$l] = (string)$callback($data[$key.'_loc'.$l->value] ?? ''); } + public function jsonSerialize() : string + { + return $this->__toString(); + } + public function __toString() : string { if ($str = $this->store[Lang::getLocale()])