public function getDomainPath($append = null) { $path = [$this->basePath, $this->configuration->getTranslationsPath(), $this->folderName]; if (!is_null($append)) { array_push($path, $append); } return implode(DIRECTORY_SEPARATOR, $path); }
/** * Sets the current domain and updates gettext domain application * * @param String $domain * @throws UndefinedDomainException If domain is not defined * @return self */ public function setDomain($domain) { if (!in_array($domain, $this->configuration->getAllDomains())) { throw new UndefinedDomainException("Domain '{$domain}' is not registered."); } bindtextdomain($domain, $this->fileSystem->getDomainPath()); bind_textdomain_codeset($domain, $this->encoding); $this->domain = textdomain($domain); return $this; }