code/libraries/joomlatools/component/koowa/translator/language.php
static public function loadFile($file, $extension, KTranslatorInterface $translator)
    {
        $lang     = JFactory::getLanguage();
        $result   = false;

        if (!isset(self::$_paths[$extension][$file]))
        {
            $strings = self::parseFile($file, $translator);

            if (count($strings))
            {
                ksort($strings, SORT_STRING);

                $lang->strings = array_merge($lang->strings, $strings);

                if (!empty($lang->override)) {
                    $lang->strings = array_merge($lang->strings, $lang->override);
                }

                $result = true;
            }

            // Record the result of loading the extension's file.
            if (!isset($lang->paths[$extension])) {
                $lang->paths[$extension] = array();
            }

            self::$_paths[$extension][$file] = $result;
        }

        return $result;
    }
static public function loadFile($file, $extension, KTranslatorInterface $translator)
    {
        $lang     = JFactory::getLanguage();
        $result   = false;

        if (!isset(self::$_paths[$extension][$file]))
        {
            $strings = self::parseFile($file, $translator);

            if (count($strings))
            {
                ksort($strings, SORT_STRING);

                $lang->strings = array_merge($lang->strings, $strings);

                if (!empty($lang->override)) {
                    $lang->strings = array_merge($lang->strings, $lang->override);
                }

                $result = true;
            }

            // Record the result of loading the extension's file.
            if (!isset($lang->paths[$extension])) {
                $lang->paths[$extension] = array();
            }

            self::$_paths[$extension][$file] = $result;
        }

        return $result;
    }
static public function loadFile ( $ file , $ extension , KTranslatorInterface $ translator ) { $ lang = JFactory :: getLanguage ( ) ; $ result = false ; if ( ! isset ( self :: $ _paths [ $ extension ] [ $ file ] ) ) { $ strings = self :: parseFile ( $ file , $ translator ) ; if ( count ( $ strings ) ) { ksort ( $ strings , SORT_STRING ) ; $ lang -> strings = array_merge ( $ lang -> strings , $ strings ) ; if ( ! empty ( $ lang -> override ) ) { $ lang -> strings = array_merge ( $ lang -> strings , $ lang -> override ) ; } $ result = true ; } // Record the result of loading the extension's file. if ( ! isset ( $ lang -> paths [ $ extension ] ) ) { $ lang -> paths [ $ extension ] = array ( ) ; } self :: $ _paths [ $ extension ] [ $ file ] = $ result ; } return $ result ; }
Adds file translations to the JLanguage catalogue.

@param string               $file       The file containing translations.
@param string               $extension  The name of the extension containing the file.
@param KTranslatorInterface $translator The Translator object.

@return bool True if translations where loaded, false otherwise.
Adds file translations to the JLanguage catalogue .