Skip to content

Commit

Permalink
piri fix etc
Browse files Browse the repository at this point in the history
  • Loading branch information
ugurakcil committed Apr 25, 2024
1 parent 385aab3 commit efbbc01
Show file tree
Hide file tree
Showing 22 changed files with 12 additions and 3 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added src/.DS_Store
Binary file not shown.
Empty file modified src/Facades/FrontRecursiveCategories.php
100755 → 100644
Empty file.
Empty file modified src/Facades/VoyagerCustom.php
100755 → 100644
Empty file.
Empty file modified src/Facades/VoyagerRecursiveCategories.php
100755 → 100644
Empty file.
4 changes: 4 additions & 0 deletions src/Helpers/bladeHelpers.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
11 changes: 8 additions & 3 deletions src/Http/Middleware/Locale.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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');

Expand All @@ -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;
Expand Down
Empty file modified src/Libraries/FrontRecursiveCategories.php
100755 → 100644
Empty file.
Empty file modified src/Libraries/VoyagerCustom.php
100755 → 100644
Empty file.
Empty file modified src/Libraries/VoyagerRecursiveCategories.php
100755 → 100644
Empty file.
Empty file modified src/Publishable/Controllers/Admin/Defaults/BrowseController.php
100755 → 100644
Empty file.
Empty file modified src/Publishable/Controllers/Admin/Widgets/NewsPostCounter.php
100755 → 100644
Empty file.
Empty file modified src/Publishable/Controllers/Admin/Widgets/PageCounter.php
100755 → 100644
Empty file.
Empty file modified src/Publishable/Models/User.php
100755 → 100644
Empty file.
Empty file modified src/Publishable/Models/Visit.php
100755 → 100644
Empty file.
Empty file modified src/Publishable/Traits/Visitable.php
100755 → 100644
Empty file.
Empty file modified src/Publishable/config/voyagerbooster.php
100755 → 100644
Empty file.
Empty file modified src/VoyagerBoosterController.php
100755 → 100644
Empty file.
Empty file modified src/VoyagerBoosterServiceProvider.php
100755 → 100644
Empty file.
Empty file.
Empty file modified src/routes.php
100755 → 100644
Empty file.
Empty file modified src/views/check.blade.php
100755 → 100644
Empty file.

0 comments on commit efbbc01

Please sign in to comment.