diff --git a/lib/classes/I18NString.php b/lib/classes/I18NString.php index 4dc61560454ae268cbf12ecd67d4d587b8940141..aebe1c8d42cba69815d19fb4991dbec587f460d3 100644 --- a/lib/classes/I18NString.php +++ b/lib/classes/I18NString.php @@ -3,9 +3,8 @@ /** * I18NString class */ -class I18NString +class I18NString implements JsonSerializable { - /** * Text in default content language. * @@ -77,6 +76,16 @@ class I18NString return (string) $this->base; } + /** + * Return the JSON representation of this i18n field in selected language. + * + * @return string + */ + public function jsonSerialize() + { + return (string) $this; + } + /** * Sets the language the content is translated into. *