mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Correzioni per gestione delle traduzioni
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
APP_NAME=Laravel
|
APP_NAME=OpenSTAManager
|
||||||
APP_ENV=local
|
APP_ENV=local
|
||||||
APP_KEY=
|
APP_KEY=
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Artisan;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class ConfigurationController extends Controller
|
class ConfigurationController extends Controller
|
||||||
@ -109,6 +110,9 @@ class ConfigurationController extends Controller
|
|||||||
$this->updateEnv($key, $value);
|
$this->updateEnv($key, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Refresh della cache sulla configurazione
|
||||||
|
Artisan::call('config:clear');
|
||||||
|
|
||||||
return redirect(route('configuration'));
|
return redirect(route('configuration'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ use App\Http\Middleware\EnsureCalendarPeriod;
|
|||||||
use App\Http\Middleware\EnsureConfiguration;
|
use App\Http\Middleware\EnsureConfiguration;
|
||||||
use App\Http\Middleware\EnsureEnvFile;
|
use App\Http\Middleware\EnsureEnvFile;
|
||||||
use App\Http\Middleware\HTMLBuilder;
|
use App\Http\Middleware\HTMLBuilder;
|
||||||
|
use App\Http\Middleware\Language;
|
||||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||||
|
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
@ -42,8 +43,8 @@ class Kernel extends HttpKernel
|
|||||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
\Xinax\LaravelGettext\Middleware\GettextMiddleware::class,
|
|
||||||
|
|
||||||
|
Language::class,
|
||||||
EnsureCalendarPeriod::class,
|
EnsureCalendarPeriod::class,
|
||||||
EnsureConfiguration::class,
|
EnsureConfiguration::class,
|
||||||
HTMLBuilder::class,
|
HTMLBuilder::class,
|
||||||
@ -63,8 +64,8 @@ class Kernel extends HttpKernel
|
|||||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||||
// \App\Http\Middleware\VerifyCsrfToken::class,
|
// \App\Http\Middleware\VerifyCsrfToken::class,
|
||||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
\Xinax\LaravelGettext\Middleware\GettextMiddleware::class,
|
|
||||||
|
|
||||||
|
Language::class,
|
||||||
EnsureCalendarPeriod::class,
|
EnsureCalendarPeriod::class,
|
||||||
EnsureConfiguration::class,
|
EnsureConfiguration::class,
|
||||||
HTMLBuilder::class,
|
HTMLBuilder::class,
|
||||||
|
27
app/Http/Middleware/Language.php
Normal file
27
app/Http/Middleware/Language.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Xinax\LaravelGettext\Facades\LaravelGettext;
|
||||||
|
|
||||||
|
class Language
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param \Closure $next
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle(Request $request, Closure $next)
|
||||||
|
{
|
||||||
|
$manager = LaravelGettext::getFacadeRoot();
|
||||||
|
|
||||||
|
$locale = env('APP_LOCALE', 'it_IT');
|
||||||
|
$manager->setLocale($locale);
|
||||||
|
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
24
app/helpers.php
Normal file
24
app/helpers.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current locale.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function locale(): string
|
||||||
|
{
|
||||||
|
return app()->getLocale();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the language portion of the locale.
|
||||||
|
* (ex. en_GB returns en)
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function localeLanguage(): string
|
||||||
|
{
|
||||||
|
$locale = locale();
|
||||||
|
|
||||||
|
return substr($locale, 0, strpos($locale, "_"));
|
||||||
|
}
|
@ -121,6 +121,7 @@
|
|||||||
"Database\\Seeders\\": "database/seeders/"
|
"Database\\Seeders\\": "database/seeders/"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
"app/helpers.php",
|
||||||
"legacy/lib/functions.php",
|
"legacy/lib/functions.php",
|
||||||
"legacy/lib/common.php",
|
"legacy/lib/common.php",
|
||||||
"legacy/lib/helpers.php",
|
"legacy/lib/helpers.php",
|
||||||
|
@ -20,7 +20,7 @@ return [
|
|||||||
* Default locale: this will be the default for your application.
|
* Default locale: this will be the default for your application.
|
||||||
* Is to be supposed that all strings are written in this language.
|
* Is to be supposed that all strings are written in this language.
|
||||||
*/
|
*/
|
||||||
'locale' => env('APP_LOCALE', 'it_IT'),
|
'locale' => 'it_IT',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Supported locales: An array containing all allowed languages
|
* Supported locales: An array containing all allowed languages
|
||||||
@ -78,7 +78,7 @@ return [
|
|||||||
/*
|
/*
|
||||||
* Translator contact data (used on .po headers too)
|
* Translator contact data (used on .po headers too)
|
||||||
*/
|
*/
|
||||||
'translator' => 'James Translator <james@translations.colm>',
|
'translator' => 'DevCode s.r.l. <info@devcode.it>',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Paths where Poedit will search recursively for strings to translate.
|
* Paths where Poedit will search recursively for strings to translate.
|
||||||
|
9862
resources/lang/i18n/catalog.pot
Normal file
9862
resources/lang/i18n/catalog.pot
Normal file
File diff suppressed because it is too large
Load Diff
BIN
resources/lang/i18n/de_DE/LC_MESSAGES/messages.mo
Normal file
BIN
resources/lang/i18n/de_DE/LC_MESSAGES/messages.mo
Normal file
Binary file not shown.
10728
resources/lang/i18n/de_DE/LC_MESSAGES/messages.po
Normal file
10728
resources/lang/i18n/de_DE/LC_MESSAGES/messages.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
resources/lang/i18n/en_GB/LC_MESSAGES/messages.mo
Normal file
BIN
resources/lang/i18n/en_GB/LC_MESSAGES/messages.mo
Normal file
Binary file not shown.
12859
resources/lang/i18n/en_GB/LC_MESSAGES/messages.po
Normal file
12859
resources/lang/i18n/en_GB/LC_MESSAGES/messages.po
Normal file
File diff suppressed because it is too large
Load Diff
4
resources/lang/i18n/it_IT/.gitignore
vendored
Normal file
4
resources/lang/i18n/it_IT/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Ignore everything in this directory
|
||||||
|
*
|
||||||
|
# Except this file
|
||||||
|
!.gitignore
|
@ -34,8 +34,8 @@
|
|||||||
decimals: "{{ formatter()->getNumberSeparators()['decimals'] }}",
|
decimals: "{{ formatter()->getNumberSeparators()['decimals'] }}",
|
||||||
thousands: "{{ formatter()->getNumberSeparators()['thousands'] }}",
|
thousands: "{{ formatter()->getNumberSeparators()['thousands'] }}",
|
||||||
|
|
||||||
locale: '{{ substr(app()->getLocale(), 0, strpos(app()->getLocale(), "_")) }}',
|
locale: '{{ localeLanguage() }}',
|
||||||
full_locale: '{{ app()->getLocale() }}',
|
full_locale: '{{ locale() }}',
|
||||||
|
|
||||||
search: search,
|
search: search,
|
||||||
translations: {
|
translations: {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="="fr">">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>@yield('title') - {{ tr('OpenSTAManager') }}</title>
|
<title>@yield('title') - {{ tr('OpenSTAManager') }}</title>
|
||||||
@ -47,8 +47,8 @@
|
|||||||
decimals: "{{ formatter()->getNumberSeparators()['decimals'] }}",
|
decimals: "{{ formatter()->getNumberSeparators()['decimals'] }}",
|
||||||
thousands: "{{ formatter()->getNumberSeparators()['thousands'] }}",
|
thousands: "{{ formatter()->getNumberSeparators()['thousands'] }}",
|
||||||
|
|
||||||
locale: '{{ substr(app()->getLocale(), 0, strpos(app()->getLocale(), "_")) }}',
|
locale: '{{ localeLanguage() }}',
|
||||||
full_locale: '{{ app()->getLocale() }}',
|
full_locale: '{{ locale() }}',
|
||||||
|
|
||||||
translations: {
|
translations: {
|
||||||
password: {
|
password: {
|
||||||
|
Reference in New Issue
Block a user