Lang function update

This commit is contained in:
decoder 2024-03-04 09:33:00 +05:00
parent 0de0459ce1
commit c18c2d0f32
12 changed files with 222 additions and 31 deletions

View File

@ -201,6 +201,8 @@ class FormController extends Controller
'form_attributes' => request()->input('form_attributes'),
'contains_page_break' => request()->input('contains_page_break'),
];
// dd($form_data);
$is_template = request()->input('is_template');
$input['schema'] = $form_data;

View File

@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Session;
class LocaleController extends Controller
{
public function __invoke($locale) {
if (! in_array($locale, ['en', 'ru', 'est'])) {
abort(400);
}
Session::put('locale', $locale);
app()->setLocale($locale);
return redirect()->back();
}
}

View File

@ -81,8 +81,8 @@ return [
'click_to_add_tags' => 'Click to add the tags',
'body' => 'Body',
'email_body' => 'Email Body',
'auto_response_settings' => 'Auto Response Settings',
'enable_auto_response' => 'Enable Auto Response?',
'auto_restonse_settings' => 'Auto Restonse Settings',
'enable_auto_restonse' => 'Enable Auto Restonse?',
'smtp_settings' => 'SMTP Settings',
'use_system_smtp' => 'Use System SMTP?',
'host' => 'Host',
@ -425,7 +425,7 @@ return [
'tour_step_2_intro' => '<b class="text-success">Step 2:</b></br> Drop the element here & click it to configure.',
'tour_step_3_intro' => '<b class="text-success">Step 3:</b></br> Form & Element configuration will appear here.',
'tour_step_4_intro' => '<b class="text-success">Step 4:</b></br> Add conditions to show/hide element based on other element values.',
'tour_step_5_intro' => '<b class="text-success">Step 5:</b></br> Configure receiving of submission email & auto-respond email to the user.',
'tour_step_5_intro' => '<b class="text-success">Step 5:</b></br> Configure receiving of submission email & auto-restond email to the user.',
'tour_step_6_intro' => '<b class="text-success">Step 6:</b></br> Configure form reCaptcha, design, notifications, scheduling, submission reference number & others.',
'tour_step_7_intro' => '<b class="text-success">Step 7:</b></br> Integrate mailchimp.',
'tour_step_8_intro' => '<b class="text-success">Step 8:</b></br> Add additional Js/css in the form.',
@ -451,7 +451,7 @@ return [
'field_name_should_nt_have_space' => 'Field name should not have space',
'duplicate_field_name_choose_unique' => 'Duplicate field name, choose unique name',
'field_dont_have_name_property' => ":input field don't have name property",
'field_contain_space' => ':input field contain whitespace in name',
'field_contain_space' => ':input field contain whitestace in name',
'field_contain_duplicate_field_name' => ':input field contain duplicate name',
'key' => 'Key',
'add_form_custom_attribute' => 'Add form custom attribute',
@ -677,4 +677,12 @@ return [
'error_msg_for_not_allowed_value' => 'Error message for not allowed value',
'enter_allowed_value_per_line' => 'Enter one allowed value per line.',
'values_allowed_tooltip' => 'Values provided here will only be allowed while submitting the form, keep it empty to allow all values',
'field_label_est' => 'Field Label in est',
'field_label_ru' => 'Field Label in Ru',
'content_est' => 'Content in est',
'content_ru' => 'Content in Ru',
'placeholder_est' => 'Placeholder in est',
'placeholder_ru' => 'Placeholder in Ru',
'options_est' => 'Options in est',
'options_ru' => 'Options in Ru',
];

2
package-lock.json generated
View File

@ -1,5 +1,5 @@
{
"name": "uniquesoft.es",
"name": "Aknaproff",
"lockfileVersion": 3,
"requires": true,
"packages": {

View File

@ -17,6 +17,26 @@
v-model="element.label">
</div>
<div class="form-group"
v-if="!_.includes(['heading', 'hr', 'html_text'], element.type)">
<label>
{{trans('messages.field_label_est')}}
<span class="error">*</span>
</label>
<input type="text" class="form-control form-control-sm"
v-model="element.label_est">
</div>
<div class="form-group"
v-if="!_.includes(['heading', 'hr', 'html_text'], element.type)">
<label>
{{trans('messages.field_label_ru')}}
<span class="error">*</span>
</label>
<input type="text" class="form-control form-control-sm"
v-model="element.label_ru">
</div>
<div class="form-group">
<label>
{{trans('messages.field_name')}}
@ -88,7 +108,6 @@
:element="element">
</pdf-uploader>
</div>
<!-- countdown -->
<div v-if="_.includes(['countdown'], element.type)">
<div class="mb-1">
@ -275,6 +294,20 @@
<input type="text" class="form-control form-control-sm"
v-model="element.placeholder">
</div>
<div class="form-group"
v-if="_.includes(['text', 'textarea', 'text_editor'], element.type)">
<label>{{trans('messages.placeholder_est')}}</label>
<input type="text" class="form-control form-control-sm"
v-model="element.placeholder_est">
</div>
<div class="form-group"
v-if="_.includes(['text', 'textarea', 'text_editor'], element.type)">
<label>{{trans('messages.placeholder_ru')}}</label>
<input type="text" class="form-control form-control-sm"
v-model="element.placeholder_ru">
</div>
<div class="form-group"
v-if="!_.includes(['heading', 'terms_and_condition', 'hr', 'html_text', 'rating', 'youtube', 'iframe', 'pdf', 'countdown'], element.type)">
@ -622,6 +655,26 @@
</small>
</div>
<div class="form-group"
v-if="_.includes(['radio', 'checkbox', 'dropdown'], element.type)">
<label>{{trans('messages.options_est')}}</label>
<textarea class="form-control form-control-sm"
v-model="element.options_est"></textarea>
<small class="form-text">
{{trans('messages.enter_one_option_per_line')}}
</small>
</div>
<div class="form-group"
v-if="_.includes(['radio', 'checkbox', 'dropdown'], element.type)">
<label>{{trans('messages.options_ru')}}</label>
<textarea class="form-control form-control-sm"
v-model="element.options_ru"></textarea>
<small class="form-text">
{{trans('messages.enter_one_option_per_line')}}
</small>
</div>
<div class="row mb-1"
v-if="_.includes(['radio', 'checkbox'], element.type)">
<div class="col-md-12">
@ -686,6 +739,20 @@
v-model="element.content"></textarea>
</div>
<div class="form-group"
v-if="_.includes(['heading'], element.type)">
<label>{{trans('messages.content_est')}}</label>
<textarea class="form-control form-control-sm"
v-model="element.content_est"></textarea>
</div>
<div class="form-group"
v-if="_.includes(['heading'], element.type)">
<label>{{trans('messages.content_ru')}}</label>
<textarea class="form-control form-control-sm"
v-model="element.content_ru"></textarea>
</div>
<div class="form-group"
v-if="_.includes(['heading'], element.type)">
<label for="heading_text_color">

View File

@ -8,7 +8,7 @@
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
@ -24,7 +24,7 @@
</div>
<input :type="element.subtype" class="form-control"
:name="element.name"
:placeholder="element.placeholder"
:placeholder="form_trans_label(element, 'placeholder')"
:class="[element.size, element.custom_class, element.conditional_class]"
:required="element.required && applyValidations"
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
@ -54,7 +54,7 @@
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
@ -98,7 +98,7 @@
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
@ -155,7 +155,7 @@
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
@ -175,7 +175,7 @@
:name="element.name"
:id="element.name"
:cols="element.columns"
:placeholder="element.placeholder"
:placeholder="form_trans_label(element, 'placeholder')"
:class="[element.custom_class, element.conditional_class]"
:required="element.required && applyValidations"
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
@ -204,7 +204,7 @@
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }} </span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@ -213,7 +213,7 @@
</label>
<div class="row">
<div :class="[spreadColumnForElement(element)]"
v-for="(option, index) in element.options.split('\n')">
v-for="(option, index) in form_trans_label(element, 'options').split('\n')">
<div class="custom-control" :class="[element.type == 'radio' ? 'custom-radio' : 'custom-checkbox']">
<input class="custom-control-input"
:type="element.type"
@ -248,7 +248,7 @@
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@ -270,7 +270,7 @@
@change="$emit('apply_conditions')"
:data-msg-required="element.required_error_msg"
>
<option v-for="option in element.options.split('\n')"
<option v-for="option in form_trans_label(element, 'options').split('\n')"
:selected="_.includes(_.get(submitted_data, element.name, ''), option)"
>
{{ option }}
@ -297,7 +297,7 @@
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<div
v-html="'<' + element.tag + ' style=color:' + element.text_color + '>' + element.content + '</' + element.tag + '>'"
v-html="'<' + element.tag + ' style=color:' + element.text_color + '>' + form_trans_label(element, 'content') + '</' + element.tag + '>'"
:class="[element.custom_class]">
</div>
</div>
@ -308,7 +308,7 @@
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@ -336,7 +336,7 @@
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@ -375,9 +375,9 @@
>
<label class="custom-control-label" for="terms_and_condition">
<a :href="element.link" target="_blank" v-if="element.link">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</a>
<span v-else>{{ element.label }}</span>
<span v-else>{{ form_trans_label(element, 'label') }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@ -412,7 +412,7 @@
<label :for="element.name">
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
:title="trans('messages.drag_element_using_icon')"></i>
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
@ -451,7 +451,7 @@
>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
@ -476,7 +476,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
<i class="fas fa-info-circle cursor-pointer modal_trigger"
@ -535,7 +535,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
@ -563,7 +563,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
@ -588,7 +588,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>
@ -617,7 +617,7 @@
:title="trans('messages.drag_element_using_icon')"></i>
<label :for="element.name">
<span :style="{'color': settings.color.label}" class="ml-2">
{{ element.label }}
{{ form_trans_label(element, 'label') }}
</span>
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
</label>

View File

@ -236,11 +236,15 @@
{ type: 'text',
subtype:'text',
label: self.trans('messages.input'),
label_est: self.trans('messages.input'),
label_ru: self.trans('messages.input'),
help_text: '',
display_icon: 'grip-lines',
prefix_icon: 'none',
suffix_icon: 'none',
placeholder:'',
placeholder_est:'',
placeholder_ru:'',
size:'',
custom_class:'',
conditional_class:'',
@ -258,6 +262,8 @@
},
{ type: 'textarea',
label: self.trans('messages.textarea'),
label_est: self.trans('messages.textarea'),
label_ru: self.trans('messages.textarea'),
help_text: '',
display_icon: 'list',
prefix_icon: 'none',
@ -265,6 +271,8 @@
rows: 3,
columns:'',
placeholder:'',
placeholder_est:'',
placeholder_ru:'',
custom_class:'',
conditional_class:'',
col:'col-md-12',
@ -277,6 +285,8 @@
},
{ type: 'dropdown',
label: self.trans('messages.dropdown'),
label_est: self.trans('messages.dropdown'),
label_ru: self.trans('messages.dropdown'),
help_text: '',
display_icon: 'caret-square-down',
prefix_icon: 'none',
@ -296,6 +306,8 @@
},
{ type: 'radio',
label: self.trans('messages.radio'),
label_est: self.trans('messages.radio'),
label_ru: self.trans('messages.radio'),
help_text: '',
spread_to_col: {
enable: false,
@ -314,6 +326,8 @@
},
{ type: 'checkbox',
label: self.trans('messages.checkbox'),
label_est: self.trans('messages.checkbox'),
label_ru: self.trans('messages.checkbox'),
help_text: '',
spread_to_col: {
enable: false,
@ -332,6 +346,8 @@
},
{ type: 'heading',
label: self.trans('messages.heading_paragrahp'),
label_est: self.trans('messages.heading_paragrahp'),
label_ru: self.trans('messages.heading_paragrahp'),
tag: 'h1',
text_color: '#212529',
content: 'Click to change it',
@ -345,6 +361,8 @@
},
{ type: 'range',
label: self.trans('messages.range'),
label_est: self.trans('messages.range'),
label_ru: self.trans('messages.range'),
help_text: '',
display_icon: 'arrows-alt-h',
min:1,
@ -362,6 +380,8 @@
},
{ type: 'calendar',
label: self.trans('messages.datetime'),
label_est: self.trans('messages.datetime'),
label_ru: self.trans('messages.datetime'),
help_text: '',
size:'',
display_icon: 'calendar-alt',
@ -387,6 +407,8 @@
{
type: 'file_upload',
label: self.trans('messages.file_upload'),
label_est: self.trans('messages.file_upload'),
label_ru: self.trans('messages.file_upload'),
help_text:'',
display_icon: 'upload',
upload_text: self.trans('messages.drop_a_file_here'),
@ -408,7 +430,11 @@
{
type: 'text_editor',
label: self.trans('messages.text_editor'),
label_est: self.trans('messages.text_editor'),
label_ru: self.trans('messages.text_editor'),
placeholder: self.trans('messages.jot_down_here'),
placeholder_est: self.trans('messages.jot_down_here'),
placeholder_ru: self.trans('messages.jot_down_here'),
help_text:'',
display_icon: 'keyboard',
editor_height: 150,
@ -424,6 +450,8 @@
{
type: 'terms_and_condition',
label: self.trans('messages.terms_condition'),
label_est: self.trans('messages.terms_condition'),
label_ru: self.trans('messages.terms_condition'),
link: '',
display_icon: 'file-signature',
custom_class: '',
@ -439,6 +467,8 @@
{
type: 'rating',
label: self.trans('messages.rating'),
label_est: self.trans('messages.rating'),
label_ru: self.trans('messages.rating'),
display_icon: 'star',
conditional_class:'',
stars_to_display:5,
@ -458,6 +488,8 @@
{
type: 'switch',
label: self.trans('messages.switch'),
label_est: self.trans('messages.switch'),
label_ru: self.trans('messages.switch'),
display_icon: 'toggle-off',
conditional_class: '',
help_text:'',
@ -473,6 +505,8 @@
{
type: 'hr',
label: self.trans('messages.horizontal_line'),
label_est: self.trans('messages.horizontal_line'),
label_ru: self.trans('messages.horizontal_line'),
padding_top:1,
padding_bottom:1,
border_size:1,
@ -490,6 +524,8 @@
{
type: 'html_text',
label: self.trans('messages.html_text'),
label_est: self.trans('messages.html_text'),
label_ru: self.trans('messages.html_text'),
html_text:'Write Something..',
display_icon: 'code',
custom_class: '',
@ -503,6 +539,8 @@
{
type: 'signature',
label: self.trans('messages.signature'),
label_est: self.trans('messages.signature'),
label_ru: self.trans('messages.signature'),
display_icon: 'signature',
col: 'col-md-12',
html_text:'',
@ -517,6 +555,8 @@
{
type: 'page_break',
label: self.trans('messages.page_break'),
label_est: self.trans('messages.page_break'),
label_ru: self.trans('messages.page_break'),
label_align: 'top',
display_icon: 'cut',
col:'col-md-12',
@ -528,6 +568,8 @@
},
{ type: 'youtube',
label: self.trans('messages.youtube'),
label_est: self.trans('messages.youtube'),
label_ru: self.trans('messages.youtube'),
display_icon: 'video',
custom_class:'',
conditional_class:'',
@ -543,6 +585,8 @@
},
{ type: 'iframe',
label: self.trans('messages.iframe_embed'),
label_est: self.trans('messages.iframe_embed'),
label_ru: self.trans('messages.iframe_embed'),
display_icon: 'crop-alt',
custom_class:'',
conditional_class:'',
@ -559,6 +603,8 @@
},
{ type: 'pdf',
label: self.trans('messages.pdf_embedder'),
label_est: self.trans('messages.pdf_embedder'),
label_ru: self.trans('messages.pdf_embedder'),
display_icon: 'file-pdf',
custom_class:'',
conditional_class:'',
@ -574,6 +620,8 @@
},
{ type: 'countdown',
label: self.trans('messages.countdown'),
label_est: self.trans('messages.countdown'),
label_ru: self.trans('messages.countdown'),
display_icon: 'hourglass-start',
custom_class: '',
conditional_class: '',

View File

@ -508,6 +508,21 @@ export default {
initialize_countdowntimer(element);
}, 2000); //initialize after 2 sec
}
},
form_trans_label (data, key) {
const currLang = document.documentElement.lang
if (currLang === 'ru') {
if (data[`${key}_ru`] == '' || data[`${key}_ru`] === undefined || data[`${key}_ru`] === null) {
return data[key];
}
return data[`${key}_ru`]
} else if (currLang === 'est') {
if (data[`${key}_est`] == '' || data[`${key}_est`] === undefined || data[`${key}_est`] === null) {
return data[key];
}
return data[`${key}_est`]
}
return data[key];
}
},
};

View File

@ -8,7 +8,6 @@
$additional_js = $form->schema['additional_js_css']['js'];
$page_color = $form->schema['settings']['color']['page_color'] ?? '#f4f6f9';
@endphp
<div class="@if(!empty($iframe_enabled) && $iframe_enabled) container-fluid @else container @endif">
<div class="row justify-content-center">
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<html lang="{{ str_replace('_', '-', session()->get('locale', 'en')) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@ -19,6 +19,33 @@
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
<li class="nav-item dropdown">
<a id="superadminDropdown" href="#" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false" class="nav-link dropdown-toggle">
{{str(session()->get('locale'))->upper()}}
</a>
<ul aria-labelledby="superadminDropdown" class="dropdown-menu border-0 shadow">
<li>
<a href="{{route('locale', 'en')}}"
class="dropdown-item @if (session()->get('locale') == 'en') active @endif">
English
</a>
</li>
<li>
<a href="{{route('locale', 'ru')}}"
class="dropdown-item @if (session()->get('locale') == 'ru') active @endif">
Русский
</a>
</li>
<li>
<a href="{{route('locale', 'est')}}"
class="dropdown-item @if (session()->get('locale') == 'est') active @endif">
Eesti keel
</a>
</li>
</ul>
</li>
@guest
<li class="nav-item d-none d-sm-inline-block">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
@ -140,4 +167,4 @@
</div>
</nav>
<!-- /.navbar -->
<!-- /.navbar -->

View File

@ -4,6 +4,7 @@ use App\Http\Controllers\FormController;
use App\Http\Controllers\FormDataCommentController;
use App\Http\Controllers\FormDataController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\LocaleController;
use App\Http\Controllers\ManageProfileController;
use App\Http\Controllers\ManageSettingsController;
use App\Http\Controllers\RegistrationController;
@ -33,6 +34,8 @@ Route::get('/', function () {
return view('welcome');
});
Route::get('locale/{locale}', LocaleController::class)->name('locale');
Route::middleware(['IsInstalled'])->group(function () {
Auth::routes(['register' => env('ENABLE_REGISTRATION', false)]);