Load Script language

@param string|array $keys
329094
public static function loadScriptLanguage($keys) {
		if (!empty($keys)) {
			$event = new Event('onApplicationLoadScriptLanguage');

			$event->setArgument('keys', $keys);

			Factory::getDispatcher()->triggerEvent($event);
		}
	}
432936
private function assertKeysArrayValid($keys = null)
    {
        if ((!$keys) ||
            (!is_array($keys)) ||
            (!isset($keys['auth'])) || 
            (!is_array($keys['auth'])) ||
            (!isset($keys['auth']['req'])) || 
            (!is_array($keys['auth']['req'])) ||
            (!isset($keys['auth']['opt'])) || 
            (!is_array($keys['auth']['opt'])) ||
            (!isset($keys['args'])) || 
            (!is_array($keys['args'])) ||
            (!isset($keys['args']['req'])) || 
            (!is_array($keys['auth']['req'])) ||
            (!isset($keys['args']['opt'])) || 
            (!is_array($keys['auth']['opt']))
        ) {
            $msg = 'Invalid API keys provided. (HINT: Each '
                 . 'API class must define a $keys array with '
                 . 'specific key requirements. (HINT: View an /Api/[file] '
                 . 'for an example.)';
            throw new ApiException($msg);
        }
    }
1368965
public function loadAllTranslations($language)
    {
        foreach ($this->loaded as $module) {
            $this->loadModuleTranslation($module, $language);
        }
    }
422096
protected function getSync(array $keys)
    {
        return sprintf(
'<div id="block-cms-%s" >
    <script>
        /*<![CDATA[*/
            (function () {
                var block, xhr;
                block = document.getElementById("block-cms-%s");
                if (window.XMLHttpRequest) {
                    xhr = new XMLHttpRequest();
                } else {
                    xhr = new ActiveXObject("Microsoft.XMLHTTP");
                }

                xhr.open("GET", "%s", false);
                xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
                xhr.send("");

                // create an empty element
                var div = document.createElement("div");
                div.innerHTML = xhr.responseText;

                for (var node in div.childNodes) {
                    if (div.childNodes[node] && div.childNodes[node].nodeType == 1) {
                        block.parentNode.replaceChild(div.childNodes[node], block);
                    }
                }
            })();
        /*]]>*/
    </script>
</div>', $keys['block_id'], $keys['block_id'], $this->router->generate('sonata_page_js_sync_cache', $keys, UrlGeneratorInterface::ABSOLUTE_URL));
    }
1040182
function load_language($file_name) {
        if ($file_name == $this->loaded_language) {
            // this file is already loaded!
            return;
        }

        //Prepare some stuff before actually loading the language file
        $this->loaded_language = $file_name;
        $this->parse_cache_built = false;
        $this->enable_highlighting();
        $language_data = array();

        //Load the language file
        require $file_name;

        // Perhaps some checking might be added here later to check that
        // $language data is a valid thing but maybe not
        $this->language_data = $language_data;

        // Set strict mode if should be set
        $this->strict_mode = $this->language_data['STRICT_MODE_APPLIES'];

        // Set permissions for all lexics to true
        // so they'll be highlighted by default
        foreach (array_keys($this->language_data['KEYWORDS']) as $key) {
            if (!empty($this->language_data['KEYWORDS'][$key])) {
                $this->lexic_permissions['KEYWORDS'][$key] = true;
            } else {
                $this->lexic_permissions['KEYWORDS'][$key] = false;
            }
        }

        foreach (array_keys($this->language_data['COMMENT_SINGLE']) as $key) {
            $this->lexic_permissions['COMMENTS'][$key] = true;
        }
        foreach (array_keys($this->language_data['REGEXPS']) as $key) {
            $this->lexic_permissions['REGEXPS'][$key] = true;
        }

        // for BenBE and future code reviews:
        // we can use empty here since we only check for existance and emptiness of an array
        // if it is not an array at all but rather false or null this will work as intended as well
        // even if $this->language_data['PARSER_CONTROL'] is undefined this won't trigger a notice
        if (!empty($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'])) {
            foreach ($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'] as $flag => $value) {
                // it's either true or false and maybe is true as well
                $perm = $value !== GESHI_NEVER;
                if ($flag == 'ALL') {
                    $this->enable_highlighting($perm);
                    continue;
                }
                if (!isset($this->lexic_permissions[$flag])) {
                    // unknown lexic permission
                    continue;
                }
                if (is_array($this->lexic_permissions[$flag])) {
                    foreach ($this->lexic_permissions[$flag] as $key => $val) {
                        $this->lexic_permissions[$flag][$key] = $perm;
                    }
                } else {
                    $this->lexic_permissions[$flag] = $perm;
                }
            }
            unset($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS']);
        }

        //Fix: Problem where hardescapes weren't handled if no ESCAPE_CHAR was given
        //You need to set one for HARDESCAPES only in this case.
        if(!isset($this->language_data['HARDCHAR'])) {
            $this->language_data['HARDCHAR'] = $this->language_data['ESCAPE_CHAR'];
        }

        //NEW in 1.0.8: Allow styles to be loaded from a separate file to override defaults
        $style_filename = substr($file_name, 0, -4) . '.style.php';
        if (is_readable($style_filename)) {
            //Clear any style_data that could have been set before ...
            if (isset($style_data)) {
                unset($style_data);
            }

            //Read the Style Information from the style file
            include $style_filename;

            //Apply the new styles to our current language styles
            if (isset($style_data) && is_array($style_data)) {
                $this->language_data['STYLES'] =
                    $this->merge_arrays($this->language_data['STYLES'], $style_data);
            }
        }
    }
600415
public function fillKeys($fileName, array $keys)
    {
        $appends = [];

        foreach ($keys as $key => $values) {
            foreach ($values as $languageKey => $value) {
                $filePath = $this->path."/{$languageKey}/{$fileName}.php";

                Arr::set($appends[$filePath], $key, $value);
            }
        }

        foreach ($appends as $filePath => $values) {
            $fileContent = $this->getFileContent($filePath, true);

            $newContent = array_replace_recursive($fileContent, $values);

            $this->writeFile($filePath, $newContent);
        }
    }
768192
public function loadTranslations($translations)
    {
        if (is_object($translations) && $translations instanceof Translations) {
            $translations = PhpArray::generate($translations, ['includeHeaders' => false]);
        } elseif (is_string($translations) && is_file($translations)) {
            $translations = include $translations;
        } elseif (!is_array($translations)) {
            throw new \InvalidArgumentException(
                'Invalid Translator: only arrays, files or instance of Translations are allowed'
            );
        }

        $this->addTranslations($translations);

        return $this;
    }
1215912
private function load()
    {
        // Get English version
        $english = $this->getTranslations(__DIR__, 'en');
        $languages = $this->getLanguages();

        $this->compareTranslations($english, $languages);
    }
1190238
private function validateKeys(array $keys)
    {
        foreach (['block_id', 'page_id', 'manager', 'updated_at'] as $key) {
            if (!isset($keys[$key])) {
                throw new \RuntimeException(sprintf('Please define a `%s` key, provided: %s', $key, json_encode(array_keys($keys))));
            }
        }
    }
336349
protected function loadKey($key)
    {
        // Pegar soh o primeiro key
        $parts = explode('.', $key);
        $first = $parts[0];

        // Verificar se item já foi adicionado
        if (array_key_exists($first, $this->items)) {
            return;
        }

        if (array_key_exists($first, $this->finded)) {
            return;
        }

        $file = config_path(sprintf('%s.php', $first));
        if (file_exists($file)) {
            $this->set($first, require $file);
        }

        $this->finded[$first] = true;
    }
272047
public function loadAllFile($folder, $language = "default") {
        $this->folder = $folder;
        $this->language = $language;
		
        $msg = array();
        if($language == "default")
            @include($folder."message.php");
        else
        @include($folder."message_".$language.".php");

        /*
         * Some OSes don't distinguish between empty array and FALSE (they may return FALSE in case of no match),
         * therefore the foreach may trigger a Warning even if there is no error
         */
        $ressourceFiles = glob($folder."message_custom_".$language."_*.php");
        if ($ressourceFiles){
            foreach ($ressourceFiles as $filename) {
                @include($filename);
            }
        }

        $this->msg = $msg;
    }
1293788
protected function parseKeys($keys)
    {
        return collect($keys)->map(function ($key) {
            if (is_string($key) && Str::startsWith($key, '{') && Str::endsWith($key, '}')) {
                $key = constant(WebDriverKeys::class.'::'.strtoupper(trim($key, '{}')));
            }

            if (is_array($key) && Str::startsWith($key[0], '{')) {
                $key[0] = constant(WebDriverKeys::class.'::'.strtoupper(trim($key[0], '{}')));
            }

            return $key;
        })->all();
    }
161899
protected function displayKeys($keys)
    {
        $this->info('Model keys:');

        foreach ($keys as $key) {

            $this->comment('  ' . $key);
        }

        $this->info('');
    }
105224
private static function load($path)
    {
        // Load language file
        if (file_exists($path)) {
            require($path);
        }

        // Populate dictionary ($dictionary is declared inside $path)
        if (isset($dictionary) && is_array($dictionary)) {
            self::$_dictionary = array_merge(self::$_dictionary, $dictionary);
        }

        // Populate transliterations ($transliterations is declared inside $path)
        if (isset($transliterations) && is_array($transliterations)) {
            self::$_transliterations = array_merge(self::$_transliterations, $transliterations);
        }
    }
923124
private function loadExtensions($extensions)
    {
        $extensions = Arr::wrap($extensions);

        foreach ($extensions as $extension) {
            $extension = 'ext'.$extension;

            if (method_exists($this, $extension)) {
                $this->$extension();
            }
        }
    }
649480
protected function loadFormat($key)
    {
        if (isset($this->overwrites[$key])) {
            return $this->overwrites[$key];
        }

        foreach ($this->localeSequence() as $locale) {
            $path = "$locale.$key";
            if (isset($this->formats[$path])) {
                return $this->formats[$path];
            }
        }

        throw new KeyNotFoundException("Format for '$key' not found in formats.'");
    }
320025
public function loadLanguage($language)
    {
        if ($this->isLoaded($language)) {
            return;
        }

        $this->strings[$language] = [];
        $this->languagesLoaded[] = $language;
    }