protected function setJsTranslation(array $scripts)
    {
        if (!empty($this->langcode) && !is_file($this->translation->getContextJsFile())) {
            foreach ($scripts as $key => $script) {
                if (strpos($key, 'system/modules/') === 0
                    && strpos($key, '/vendor/') === false
                    && !empty($script['file'])) {
                    $string = file_get_contents($script['file']);
                    $this->translation->createJsTranslation($string);
                }
            }
        }
    }
protected function setJsTranslation(array $scripts)
    {
        if (!empty($this->langcode) && !is_file($this->translation->getContextJsFile())) {
            foreach ($scripts as $key => $script) {
                if (strpos($key, 'system/modules/') === 0
                    && strpos($key, '/vendor/') === false
                    && !empty($script['file'])) {
                    $string = file_get_contents($script['file']);
                    $this->translation->createJsTranslation($string);
                }
            }
        }
    }
protected function setJsTranslation ( array $ scripts ) { if ( ! empty ( $ this -> langcode ) && ! is_file ( $ this -> translation -> getContextJsFile ( ) ) ) { foreach ( $ scripts as $ key => $ script ) { if ( strpos ( $ key , 'system/modules/' ) === 0 && strpos ( $ key , '/vendor/' ) === false && ! empty ( $ script [ 'file' ] ) ) { $ string = file_get_contents ( $ script [ 'file' ] ) ; $ this -> translation -> createJsTranslation ( $ string ) ; } } } }
Extracts translatable strings from JS files and creates translation
@param array $scripts
Extracts translatable strings from JS files and creates translation