/** * Returns category slug * * @param Locale $locale * @param string $categoryName * * @return mixed|string */ protected function getLocaleSlug(Locale $locale, $categoryName) { $slug = Sluggable::makeSlug($categoryName); $currentLocale = $this->getRequestHelper()->getCurrentLocale(); if ($locale->getCode() != $currentLocale) { $slug = Sluggable::makeSlug(sprintf('%s-%s', $categoryName, $locale->getCode())); } return $slug; }
/** * Returns parsed translations from filesystem * * @param Locale $locale */ protected function getFilesystemTranslationsForLocale(Locale $locale) { $filename = sprintf('wellcommerce.%s.yml', $locale->getCode()); $filesystem = $this->getFilesystem(); $path = $this->getFilesystemTranslationsPath() . DIRECTORY_SEPARATOR . $filename; if ($filesystem->exists($path)) { return $this->parseYaml($path); } return []; }