trendschau 5 роки тому
батько
коміт
8df40a1902
1 змінених файлів з 6 додано та 2 видалено
  1. 6 2
      system/system.php

+ 6 - 2
system/system.php

@@ -221,7 +221,12 @@ $container['view'] = function ($container) use ($uri)
 	/******************************
 	/******************************
 	* LOAD TRANSLATIONS           *
 	* LOAD TRANSLATIONS           *
 	******************************/
 	******************************/
-  	if(isset($uri->getPath()) && (strpos($uri->getPath(),'/tm/') !== false OR strpos($uri->getPath(),'/setup') !== false))
+  	$uri = $_SERVER['REQUEST_URI'];
+
+    $base_path = $container['request']->getUri()->getBasePath();
+    $uri = str_replace($base_path,'',$uri);
+    $pieces = explode('/',$uri);
+    if(isset($uri) && ($pieces[1] === 'tm' OR $pieces[1] === 'setup') )
   	{
   	{
     	// Admin environment labels
     	// Admin environment labels
     	$labels = Typemill\Translations::loadTranslations('admin');
     	$labels = Typemill\Translations::loadTranslations('admin');
@@ -230,7 +235,6 @@ $container['view'] = function ($container) use ($uri)
     	// For now it is useless, but it will prove useful in the future
     	// For now it is useless, but it will prove useful in the future
     	$labels = Typemill\Translations::loadTranslations('user');
     	$labels = Typemill\Translations::loadTranslations('user');
   	}
   	}
-  	$container['translations'] = $labels;
   	$view['translations'] = $labels;
   	$view['translations'] = $labels;
 	$view->addExtension(new Typemill\Extensions\TwigLanguageExtension( $labels ));
 	$view->addExtension(new Typemill\Extensions\TwigLanguageExtension( $labels ));