refactor(plg): include Translations wrapper in translation class

This commit is contained in:
Zack Spear
2023-11-15 14:24:40 -08:00
parent 44e7d811aa
commit 02671a38d6

View File

@@ -34,6 +34,9 @@
* $wCTranslations->getTranslations();
* ```
*/
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
require_once "$docroot/webGui/include/Translations.php";
class WebComponentTranslations
{
private $translations = [];
@@ -384,6 +387,10 @@ class WebComponentTranslations
return $this->translations ?? [];
}
/**
* @param $urlEncode {bool}
* @return string
*/
public function getTranslationsJson($urlEncode = false)
{
if ($urlEncode) {