From 8784515fbc06c660d8d094ed27fdd1ab56012c22 Mon Sep 17 00:00:00 2001 From: uran1980 Date: Tue, 10 Mar 2015 17:52:13 +0200 Subject: [PATCH] fix location --- composer.json | 2 +- models/search/SourceMessageSearch.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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 {