diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..d5d79fe Binary files /dev/null and b/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..b60164b Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/Facades/FrontRecursiveCategories.php b/src/Facades/FrontRecursiveCategories.php old mode 100755 new mode 100644 diff --git a/src/Facades/VoyagerCustom.php b/src/Facades/VoyagerCustom.php old mode 100755 new mode 100644 diff --git a/src/Facades/VoyagerRecursiveCategories.php b/src/Facades/VoyagerRecursiveCategories.php old mode 100755 new mode 100644 diff --git a/src/Helpers/bladeHelpers.php b/src/Helpers/bladeHelpers.php old mode 100755 new mode 100644 index 8b0a025..1af9257 --- a/src/Helpers/bladeHelpers.php +++ b/src/Helpers/bladeHelpers.php @@ -140,6 +140,10 @@ function piri($name, $parameters = []) { // 'locale' parametresini array'den kaldır if(!\Config::get('app.multidomain')) { + if($name == 'home' && $lang == key(\Config::get('app.available_locales'))) { + return url(route('index', $parameters, false)); + } + return url(route($name, $parameters, false)); } diff --git a/src/Http/Middleware/Locale.php b/src/Http/Middleware/Locale.php old mode 100755 new mode 100644 index b23a699..47de8ed --- a/src/Http/Middleware/Locale.php +++ b/src/Http/Middleware/Locale.php @@ -16,7 +16,7 @@ class Locale */ public function handle($request, Closure $next) { - $locale = $this->detectLocale(); + $locale = $this->detectLocale($request); app()->setLocale($locale); Carbon::setLocale($locale); @@ -25,7 +25,7 @@ public function handle($request, Closure $next) return $next($request); } - protected function detectLocale() + protected function detectLocale($request) { $available_locales = \Config::get('app.available_locales'); @@ -40,15 +40,20 @@ protected function detectLocale() } // Check segment-based locale + /** + * Kullanıcı segment üzerinden bir dil tercihine sahipse + * site üzerinde o dil tercihi ile devam etmeli + */ $segmentLocaleKey = request()->segment(1); if (array_key_exists($segmentLocaleKey, $available_locales)) { - \URL::defaults(['lang' => $segmentLocaleKey]); return $segmentLocaleKey; } + // default lang $defaultLocaleKey = array_key_first($available_locales); + \URL::defaults(['lang' => $defaultLocaleKey]); // Return default locale return $defaultLocaleKey; diff --git a/src/Libraries/FrontRecursiveCategories.php b/src/Libraries/FrontRecursiveCategories.php old mode 100755 new mode 100644 diff --git a/src/Libraries/VoyagerCustom.php b/src/Libraries/VoyagerCustom.php old mode 100755 new mode 100644 diff --git a/src/Libraries/VoyagerRecursiveCategories.php b/src/Libraries/VoyagerRecursiveCategories.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Controllers/Admin/Defaults/BrowseController.php b/src/Publishable/Controllers/Admin/Defaults/BrowseController.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Controllers/Admin/Widgets/NewsPostCounter.php b/src/Publishable/Controllers/Admin/Widgets/NewsPostCounter.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Controllers/Admin/Widgets/PageCounter.php b/src/Publishable/Controllers/Admin/Widgets/PageCounter.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Models/User.php b/src/Publishable/Models/User.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Models/Visit.php b/src/Publishable/Models/Visit.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Traits/Visitable.php b/src/Publishable/Traits/Visitable.php old mode 100755 new mode 100644 diff --git a/src/Publishable/config/voyagerbooster.php b/src/Publishable/config/voyagerbooster.php old mode 100755 new mode 100644 diff --git a/src/VoyagerBoosterController.php b/src/VoyagerBoosterController.php old mode 100755 new mode 100644 diff --git a/src/VoyagerBoosterServiceProvider.php b/src/VoyagerBoosterServiceProvider.php old mode 100755 new mode 100644 diff --git a/src/database/migrations/2020_10_16_113349_create_visits_table.php b/src/database/migrations/2020_10_16_113349_create_visits_table.php old mode 100755 new mode 100644 diff --git a/src/routes.php b/src/routes.php old mode 100755 new mode 100644 diff --git a/src/views/check.blade.php b/src/views/check.blade.php old mode 100755 new mode 100644