Return an array with all domain names
public getAllDomains ( ) : array | ||
return | array |
/** * Adds a new locale directory + .po file * * @param String $localePath * @param String $locale * @throws FileCreationException */ public function addLocale($localePath, $locale) { $data = array($localePath, "LC_MESSAGES"); if (!file_exists($localePath)) { $this->createDirectory($localePath); } if ($this->configuration->getCustomLocale()) { $data[1] = 'C'; $gettextPath = implode($data, DIRECTORY_SEPARATOR); if (!file_exists($gettextPath)) { $this->createDirectory($gettextPath); } $data[2] = 'LC_MESSAGES'; } $gettextPath = implode($data, DIRECTORY_SEPARATOR); if (!file_exists($gettextPath)) { $this->createDirectory($gettextPath); } // File generation for each domain foreach ($this->configuration->getAllDomains() as $domain) { $data[3] = $domain . ".po"; $localePOPath = implode($data, DIRECTORY_SEPARATOR); if (!$this->createPOFile($localePOPath, $locale, $domain)) { throw new FileCreationException(sprintf('Can\'t create the file: %s', $localePOPath)); } } }
/** * Adds a new locale directory + .po file * * @param String $localePath * @param String $locale * @throws FileCreationException */ public function addLocale($localePath, $locale) { $this->createDirectory($localePath); $gettextPath = $localePath . DIRECTORY_SEPARATOR . "LC_MESSAGES"; $this->createDirectory($gettextPath); // File generation for each domain foreach ($this->configuration->getAllDomains() as $domain) { $localePOPath = implode(array($localePath, "LC_MESSAGES", $domain . ".po"), DIRECTORY_SEPARATOR); if (!$this->createPOFile($localePOPath, $locale, $domain)) { throw new FileCreationException("I can't create the file: {$localePOPath}"); } } }
/** * Adds a new locale directory + .po file * * @param String $localePath * @param String $locale * @throws FileCreationException */ public function addLocale($localePath, $locale) { $this->createDirectory($localePath); $gettextPath = $localePath . DIRECTORY_SEPARATOR . "LC_MESSAGES"; $this->createDirectory($gettextPath); // File generation for each domain foreach ($this->configuration->getAllDomains() as $domain) { $data = [$localePath, "LC_MESSAGES", $domain . ".po"]; $localePOPath = implode($data, DIRECTORY_SEPARATOR); if (!$this->createPOFile($localePOPath, $locale, $domain)) { throw new FileCreationException(sprintf('Can\'t create the file: %s', $localePOPath)); } } }