<?php
// Own namespace
-namespace CoreFramework\Localization;
+namespace Org\Mxchange\CoreFramework\Localization;
// Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
-use CoreFramework\Object\BaseFrameworkSystem;
-use CoreFramework\Registry\Registerable;
-use CoreFramework\Registry\Registry;
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+
+// Import SPL stuff
+use \InvalidArgumentException;
/**
* The language sub-system for handling language strings being used in the
*
* @param $languageBasePath The local base path for all language strings or emty for auto-detection
* @return $langInstance An instance of LanguageSystem
- * @throws LanguagePathIsEmptyException If the provided $languageBasePath is empty
+ * @throws InvalidArgumentException If languageBasePath remains empty (@TODO Get rid of that old-lost code)
* @throws InvalidLanguagePathStringException If $languageBasePath is no string
* @throws LanguagePathIsNoDirectoryException If $languageBasePath is no
* directory or not found
if (empty($languageBasePath)) {
// No, then attempt "auto-dection":
// 1) Get application
- $applicationInstance = Registry::getRegistry()->getInstance('app');
+ $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
// 2) Try to build it
$languageBasePath = sprintf('%s%s/language/',
// 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);
$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;