feat: ✨ Select lingua
This commit is contained in:
parent
59c50c80b4
commit
4b6a3d599b
|
@ -98,7 +98,7 @@
|
|||
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="20">
|
||||
<list size="21">
|
||||
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
||||
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
||||
<item index="2" class="java.lang.String" itemvalue="comment" />
|
||||
|
@ -119,6 +119,7 @@
|
|||
<item index="17" class="java.lang.String" itemvalue="mwc-dialog" />
|
||||
<item index="18" class="java.lang.String" itemvalue="text-field" />
|
||||
<item index="19" class="java.lang.String" itemvalue="text-area" />
|
||||
<item index="20" class="java.lang.String" itemvalue="mwc-select" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
|
|
|
@ -145,7 +145,7 @@ export default class SetupPage extends Page {
|
|||
</Cell>
|
||||
<Cell>
|
||||
<h4>{__('Lingua')}</h4>
|
||||
<mwc-select>
|
||||
<mwc-select id="language-select">
|
||||
{this.languages()}
|
||||
</mwc-select>
|
||||
<hr />
|
||||
|
@ -195,6 +195,8 @@ export default class SetupPage extends Page {
|
|||
.toggleClass('mdc-high-contrast');
|
||||
});
|
||||
|
||||
$('mwc-select#language-select').on('action', this.onLanguageSelected);
|
||||
|
||||
// Fix for mwc button inside <a> tags
|
||||
$('a')
|
||||
.has('mwc-button')
|
||||
|
@ -216,6 +218,10 @@ export default class SetupPage extends Page {
|
|||
this.saveDatabase(formData);
|
||||
}
|
||||
|
||||
onLanguageSelected(event: Event) {
|
||||
window.location.href = window.route('app.language', {language: event.target.value});
|
||||
}
|
||||
|
||||
async testDatabase(silent = false): boolean {
|
||||
const form = $('form');
|
||||
let response;
|
||||
|
|
|
@ -26,10 +26,10 @@ Route::inertia('setup', 'SetupPage', [
|
|||
)),
|
||||
'license' => cache()->rememberForever('app.license', fn () => file_get_contents(base_path('LICENSE'))),
|
||||
]);
|
||||
Route::options('setup/test', [SetupController::class, 'testDatabase'])->name('setup.test')->withoutMiddleware('csrf')->middleware(\Illuminatech\MultipartMiddleware\MultipartFormDataParser::class);
|
||||
Route::options('setup/test', [SetupController::class, 'testDatabase'])->name('setup.test')->withoutMiddleware('csrf');
|
||||
|
||||
Route::get('lang/{language}', function ($language) {
|
||||
app()->setLocale($language);
|
||||
|
||||
return redirect()->back();
|
||||
})->name('language');
|
||||
})->name('app.language');
|
||||
|
|
Loading…
Reference in New Issue