X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=framework%2Fmain%2Fclasses%2Flanguage%2Fclass_LanguageSystem.php;h=99df420951bee5bbac8c46b50098256e73c25d25;hb=b002c5909aa0f781505dde5414964b0f014cde01;hp=0c2875ac2c9740666d07ecdb437f151d01be50f0;hpb=78a010fef84895720e796842208f01dfb619c332;p=core.git diff --git a/framework/main/classes/language/class_LanguageSystem.php b/framework/main/classes/language/class_LanguageSystem.php index 0c2875ac..99df4209 100644 --- a/framework/main/classes/language/class_LanguageSystem.php +++ b/framework/main/classes/language/class_LanguageSystem.php @@ -1,12 +1,15 @@ getInstance('app'); + $applicationInstance = GenericRegistry::getRegistry()->getInstance('app'); // 2) Try to build it - $languageBasePath = sprintf('%sapplication/%s/language/', - $langInstance->getConfigInstance()->getConfigEntry('base_path'), - // Don't allow any underscores/dashes in application names - str_replace(array('_', '-'), array('', ''), $applicationInstance->getAppShortName()) + $languageBasePath = sprintf('%s%s/language/', + $langInstance->getConfigInstance()->getConfigEntry('application_base_path'), + $applicationInstance->getAppShortName() ); } // END - if // Is the base path valid? if (empty($languageBasePath)) { // Language path is empty - throw new LanguagePathIsEmptyException($langInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('languageBasePath is still empty'); } elseif (!is_string($languageBasePath)) { // Is not a string throw new InvalidLanguagePathStringException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_STRING); @@ -114,7 +116,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage, $langInstance->initLanguageStrings(); // Set language code from default config - $langInstance->setLanguageCode(FrameworkConfiguration::getSelfInstance()->getConfigEntry('default_lang')); + $langInstance->setLanguageCode(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_lang')); // Remember this instance self::$selfInstance = $langInstance;