Back to AbstractModuleDispatcher class

Method loadLanguage

protected void
loadLanguage
()
Load the language.
Returns
  • void
Since
  • 4.0.0

Method loadLanguage - Source code

/**
 * Load the language.
 *
 * @return  void
 *
 * @since   4.0.0
 */
protected function loadLanguage()
{
    $language = $this->app->getLanguage();
    $coreLanguageDirectory = JPATH_BASE;
    $extensionLanguageDirectory = JPATH_BASE . '/modules/' . $this->module->module;
    $langPaths = $language->getPaths();
    // Only load the module's language file if it hasn't been already
    if (!$langPaths || !isset($langPaths[$coreLanguageDirectory]) && !isset($langPaths[$extensionLanguageDirectory])) {
        // 1.5 or Core then 1.6 3PD
        $language->load($this->module->module, $coreLanguageDirectory) || $language->load($this->module->module, $extensionLanguageDirectory);
    }
}