Skip to content

Commit c0097f3

Browse files
committed
Mapper/Objectives
* fix display of item objectives by making LocString JsonSerializable
1 parent 92c58cc commit c0097f3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

includes/components/locstring.class.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
die('illegal access');
77

88

9-
class LocString
9+
class LocString implements \JsonSerializable
1010
{
1111
private \WeakMap $store;
1212

@@ -24,6 +24,11 @@ public function __construct(array $data, string $key = 'name', ?callable $callba
2424
$this->store[$l] = (string)$callback($data[$key.'_loc'.$l->value] ?? '');
2525
}
2626

27+
public function jsonSerialize() : string
28+
{
29+
return $this->__toString();
30+
}
31+
2732
public function __toString() : string
2833
{
2934
if ($str = $this->store[Lang::getLocale()])

0 commit comments

Comments
 (0)