Merge pull request #15949 from owncloud/l10n-string-json
Implement json serialize for l10n string
This commit is contained in:
commit
d308ec4f0e
|
@ -24,7 +24,9 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class OC_L10N_String{
|
use JsonSerializable;
|
||||||
|
|
||||||
|
class OC_L10N_String implements JsonSerializable {
|
||||||
/**
|
/**
|
||||||
* @var OC_L10N
|
* @var OC_L10N
|
||||||
*/
|
*/
|
||||||
|
@ -74,4 +76,10 @@ class OC_L10N_String{
|
||||||
$text = str_replace('%n', $this->count, $text);
|
$text = str_replace('%n', $this->count, $text);
|
||||||
return vsprintf($text, $this->parameters);
|
return vsprintf($text, $this->parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function jsonSerialize() {
|
||||||
|
return $this->__toString();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue