diff --git a/composer.json b/composer.json index b982ea5..87de979 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "uran1980/yii2-translate-panel", "description": "Yii2 Translate Panel makes the translation of your application awesome!", - "version": "0.1.7", + "version": "0.1.8", "type": "yii2-extension", "keywords": [ "yii2", diff --git a/models/search/SourceMessageSearch.php b/models/search/SourceMessageSearch.php index 9f4f309..d26cfcc 100644 --- a/models/search/SourceMessageSearch.php +++ b/models/search/SourceMessageSearch.php @@ -534,11 +534,11 @@ protected function extractMessages($fileName, $translator) $messages[$category][] = $message; foreach ($this->config['sourcePath'] as $sourcePath) { - $parts = explode('/', $sourcePath); - $key = count($parts) - 1; - $location = $parts[$key] . str_replace(realpath($sourcePath), '', $fileName); + $location = str_replace(realpath($sourcePath), '', $fileName); if ( $location !== $fileName ) { - $this->locations[$category][] = [md5($message) => $location]; + $parts = explode('/', $sourcePath); + $key = count($parts) - 1; + $this->locations[$category][] = [md5($message) => $parts[$key] . $location]; } } } else {