private function handleResource(
        TranslationResource $resource,
        $translationMode,
        $allLanguages,
        OutputInterface $output
    ) {
        if (substr($resource->getSlug(), 0, strlen($this->prefix)) != $this->prefix) {
            $this->writelnVerbose(
                $output,
                sprintf(
                    'Received resource <info>%s</info> is not for this repository, ignored.',
                    $resource->getSlug()
                )
            );
            return;
        }
        $this->writeln($output, sprintf('Processing resource <info>%s</info>', $resource->getSlug()));

        $this->writelnVerbose(
            $output,
            sprintf('Polling languages from resource <info>%s</info>', $resource->getSlug())
        );
        $resource->fetchDetails();

        foreach (array_keys($resource->getAvailableLanguages()) as $code) {
            // We are using 2char iso 639-1 in Contao - what a pity.
            if (!$this->isHandlingLanguage($code, $allLanguages)) {
                $this->writelnVerbose($output, sprintf('skipping language <info>%s</info>', $code));
                continue;
            }

            $this->handleLanguage($resource, $code, $translationMode, $output);
        }
    }
private function handleResource(
        TranslationResource $resource,
        $translationMode,
        $allLanguages,
        OutputInterface $output
    ) {
        if (substr($resource->getSlug(), 0, strlen($this->prefix)) != $this->prefix) {
            $this->writelnVerbose(
                $output,
                sprintf(
                    'Received resource <info>%s</info> is not for this repository, ignored.',
                    $resource->getSlug()
                )
            );
            return;
        }
        $this->writeln($output, sprintf('Processing resource <info>%s</info>', $resource->getSlug()));

        $this->writelnVerbose(
            $output,
            sprintf('Polling languages from resource <info>%s</info>', $resource->getSlug())
        );
        $resource->fetchDetails();

        foreach (array_keys($resource->getAvailableLanguages()) as $code) {
            // We are using 2char iso 639-1 in Contao - what a pity.
            if (!$this->isHandlingLanguage($code, $allLanguages)) {
                $this->writelnVerbose($output, sprintf('skipping language <info>%s</info>', $code));
                continue;
            }

            $this->handleLanguage($resource, $code, $translationMode, $output);
        }
    }
private function handleResource ( TranslationResource $ resource , $ translationMode , $ allLanguages , OutputInterface $ output ) { if ( substr ( $ resource -> getSlug ( ) , 0 , strlen ( $ this -> prefix ) ) != $ this -> prefix ) { $ this -> writelnVerbose ( $ output , sprintf ( 'Received resource <info>%s</info> is not for this repository, ignored.' , $ resource -> getSlug ( ) ) ) ; return ; } $ this -> writeln ( $ output , sprintf ( 'Processing resource <info>%s</info>' , $ resource -> getSlug ( ) ) ) ; $ this -> writelnVerbose ( $ output , sprintf ( 'Polling languages from resource <info>%s</info>' , $ resource -> getSlug ( ) ) ) ; $ resource -> fetchDetails ( ) ; foreach ( array_keys ( $ resource -> getAvailableLanguages ( ) ) as $ code ) { // We are using 2char iso 639-1 in Contao - what a pity. if ( ! $ this -> isHandlingLanguage ( $ code , $ allLanguages ) ) { $ this -> writelnVerbose ( $ output , sprintf ( 'skipping language <info>%s</info>' , $ code ) ) ; continue ; } $ this -> handleLanguage ( $ resource , $ code , $ translationMode , $ output ) ; } }
Handle a single resource.

@param TranslationResource $resource        The resource to process.

@param string              $translationMode The translation mode.

@param bool                $allLanguages    Boolean flag if all languages shall be fetched.

@param OutputInterface     $output          The output interface to use.

@return void
Handle a single resource .