/** * Retrieve a single resource with a given slug. * * @param string $slug The slug of the resource. * * @return TranslationResource */ public function getResource($slug) { $resource = new TranslationResource($this->getTransport()); $resource->setProject($this->getSlug()); $resource->setSlug($slug); $resource->fetchDetails(); return $resource; }
private function initializeIfNeeded() { foreach ($this->filepaths as $key => $filepath) { $resource = new TranslationResource($filepath); $this->resources[] = $resource; $this->resourcesLocales[] = $resource->getLocale(); } $this->resourcesLocales = array_unique($this->resourcesLocales); $this->filepaths = []; }