-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:edwardcrompton/php-lle into main
- Loading branch information
Showing
18 changed files
with
291 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Closure; | ||
use Illuminate\Http\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
class Localization | ||
{ | ||
/** | ||
* Handle an incoming request. | ||
* | ||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next | ||
*/ | ||
public function handle(Request $request, Closure $next): Response | ||
{ | ||
$locale = $request->route('locale'); | ||
if (in_array($locale, config('app.available_locales'))) { | ||
app()->setLocale($locale); | ||
} | ||
return $next($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App\Services; | ||
|
||
class UrlLocaliser { | ||
public function route($route) { | ||
return route($route, ['locale' => app()->getLocale()]); | ||
} | ||
|
||
public function redirect($route) { | ||
return redirect()->route($route, ['locale' => app()->getLocale()]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"Search places": "Chwilio lleodd", | ||
"Search": "Chwilio", | ||
"Search results": "Canlyniadau chwilio", | ||
"Location": "Lleoliad", | ||
"Update audio": "Ail-wneud clip sain", | ||
"This list shows the latest audio clips.": "Mae rhestr hynna yn dangos y clipau sain diwethaf.", | ||
"Search for a place name to add a new audio clip.": "Chwilach am enw lle er mwyn creu clip newydd.", | ||
"Audio files will be shown if they already exist.": "", | ||
"Start recording": "Dechrach recordio", | ||
"Stop recording": "Stopach recordio", | ||
"Save": "Archebu", | ||
"Showing": "Yn dangos", | ||
"to": "i", | ||
"of": "o", | ||
"results": "canlyniad", | ||
"pagination.previous": "« Blaenorol", | ||
"pagination.next": "Nesa »", | ||
"Place name": "Enw lle", | ||
"Place": "Lle", | ||
"Search for a place name": "Chwilach am enw lle", | ||
"Audio file": "", | ||
"No file selected": "", | ||
"Audio uploaded successfully.": "", | ||
"No audio file was provided.": "", | ||
"Location address": "", | ||
"Results for :place": "", | ||
"Audio recorder": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.