Xinax\LaravelGettext\FileSystem::getDomainPath PHP Method

getDomainPath() public method

Constructs and returns the full path to the translation files
public getDomainPath ( null $append = null ) : string
$append null
return string
    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);
    }

Usage Example

Example #1
0
 /**
  * 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;
 }
All Usage Examples Of Xinax\LaravelGettext\FileSystem::getDomainPath