mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Correzioni minori e aggiornamento a Laravel 9
This commit is contained in:
40
app/LaravelGettext/Adapters/LaravelAdapter.php
Normal file
40
app/LaravelGettext/Adapters/LaravelAdapter.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\LaravelGettext\Adapters;
|
||||
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
class LaravelAdapter implements AdapterInterface
|
||||
{
|
||||
/**
|
||||
* Set current locale
|
||||
*
|
||||
* @param string $locale
|
||||
* @return bool
|
||||
*/
|
||||
public function setLocale($locale)
|
||||
{
|
||||
App::setLocale(substr($locale, 0, 2));
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the locale
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocale()
|
||||
{
|
||||
return App::getLocale();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the application path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getApplicationPath()
|
||||
{
|
||||
return app_path();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user