upgrade of __t function, add save default_language to cache

This commit is contained in:
Milos Holba
2021-03-22 20:27:47 +01:00
parent 5910bb1206
commit df5d5cb75f
17 changed files with 351 additions and 122 deletions
@@ -10,7 +10,7 @@
<user-icon v-if="selected.icon === 'user'" size="14"></user-icon>
<edit2-icon v-if="selected.icon === 'user-edit'" size="14"></edit2-icon>
</div>
<span class="option-value">{{ $t(`${selected.label}`) }}</span>
<span class="option-value">{{ selected.label }}</span>
</div>
<!--If is empty-->
@@ -29,7 +29,7 @@
<user-icon v-if="option.icon === 'user'" size="14"></user-icon>
<edit2-icon v-if="option.icon === 'user-edit'" size="14"></edit2-icon>
</div>
<span class="option-value">{{ $t(`${option.label}`) }}</span>
<span class="option-value">{{ option.label }}</span>
</li>
</ul>
</transition>
@@ -182,7 +182,7 @@ export default {
margin-bottom: 5px;
.language-label {
color: $text-muted;
color: $light_text;
font-weight: 700;
@include font-size(12);
margin-top: 20px;
@@ -203,7 +203,7 @@ export default {
}
.name {
color: $theme;
color: $theme !important;
}
}
@@ -239,4 +239,16 @@ export default {
// display: none;
// }
// }
@media (prefers-color-scheme: dark) {
.language{
.name {
color: $dark_mode_text_primary !important;
}
}
.language-label {
color: $dark_mode_text_secondary !important;
}
}
</style>
@@ -1,6 +1,6 @@
<template>
<!-- Serach bar -->
<div v-if="strings" class="language-strings-wrapper">
<div v-if="strings" class="language-strings-wrapper form-block form">
<div class="search-bar-wrapper">
<div class="search-bar">
<div v-if="!searchInput" class="icon" >
@@ -15,7 +15,7 @@
class="query"
type="text"
name="searchInput"
placeholder="Search Language Strings"
placeholder="Search Language Strings..."
/>
</div>
</div>
@@ -58,7 +58,9 @@
<!-- Strings -->
<FormLabel class="mt-70">Language Strings</FormLabel>
<Spinner v-if="!loadSearch || filteredStrings.length === 0"/>
<Spinner class="spinner" v-if="!loadSearch || filteredStrings.length === 0 && !searchInput"/>
<div v-if="loadSearch && filteredStrings.length > 0">
<div class="block-wrapper string" v-for="(string,index) in filteredStrings" :key="index">
<label> {{string.value}}:</label>
@@ -72,6 +74,12 @@
</ValidationProvider>
</div>
</div>
<!-- Not Fount -->
<div class="not-found-wrapper" v-if="loadSearch && filteredStrings.length === 0 && searchInput">
<span class="not-found">Not Found</span>
</div>
</div>
</div>
@@ -118,6 +126,8 @@ export default {
watch: {
activeLanguage () {
this.getLanguageStrings(this.activeLanguage)
this.searchInput = ''
}
},
methods: {
@@ -215,6 +225,24 @@ export default {
@import '@assets/vue-file-manager/_mixins';
@import '@assets/vue-file-manager/_forms';
.spinner {
top: 60% !important;
}
.not-found-wrapper {
display: flex;
margin-top: 20%;
.not-found {
margin: auto;
font-weight: 700;
padding: 10px;
border-radius: 8px;
background: $light_background;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}
}
.string:last-child {
margin-bottom: 32px !important;
}
@@ -236,6 +264,7 @@ export default {
margin: 0 auto;
display: flex;
flex-direction: column;
position: relative;
.block-form{
overflow-y: scroll;
@@ -258,7 +287,7 @@ export default {
border-radius: 8px;
outline: 0;
padding: 9px 20px 9px 43px;
font-weight: 400;
font-weight: 700;
@include font-size(16);
width: 100%;
height: 50px;
@@ -268,9 +297,9 @@ export default {
-webkit-appearance: none;
&::placeholder {
color: $text-muted;
color: $light_text;
@include font-size(14);
font-weight: 500;
font-weight: 700;
}
&:focus {
@@ -296,7 +325,7 @@ export default {
circle,
line {
color: $text-muted;
color: $light_text;
}
.pointer {
@@ -324,7 +353,6 @@ export default {
padding: 9px 20px 9px 30px;
&:focus {
border: 1px solid transparent;
box-shadow: none;
}
}
@@ -339,16 +367,23 @@ export default {
@media (prefers-color-scheme: dark) {
.search-bar {
input {
border-color: transparent;
color: $dark_mode_text_primary;
background: $dark_mode_background ;
&::placeholder {
color: $dark_mode_text_secondary;
}
}
.icon svg path {
fill: $dark_mode_text_secondary;
.icon {
circle,
line {
color: $dark_mode_text_secondary !important;
}
}
}
.not-found-wrapper {
.not-found {
background: $dark_mode_foreground !important;
}
}
}
@@ -20,7 +20,7 @@
<!--Email-->
<div class="block-wrapper">
<label>{{ $t('page_registration.label_email') }}</label>
<label>{{ $t('page_registration.label_email') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="email" rules="required" v-slot="{ errors }">
<input v-model="user.email" :placeholder="$t('admin_page_user.create_user.label_email')" type="email" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
@@ -29,7 +29,7 @@
<!--Name-->
<div class="block-wrapper">
<label>{{ $t('page_registration.label_name') }}</label>
<label>{{ $t('page_registration.label_name') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="user name" rules="required" v-slot="{ errors }">
<input v-model="user.name" :placeholder="$t('admin_page_user.create_user.label_name')" type="text" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
@@ -39,7 +39,7 @@
<!--Password-->
<div class="wrapper-inline">
<div class="block-wrapper">
<label>{{ $t('page_registration.label_pass') }}</label>
<label>{{ $t('page_registration.label_pass') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="password" rules="required" v-slot="{ errors }">
<input v-model="user.password" :placeholder="$t('page_registration.placeholder_pass')" type="password" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
@@ -47,7 +47,7 @@
</div>
<div class="block-wrapper">
<label>{{ $t('page_registration.label_confirm_pass') }}</label>
<label>{{ $t('page_registration.label_confirm_pass') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="password confirm" rules="required" v-slot="{ errors }">
<input v-model="user.password_confirmation" :placeholder="$t('admin_page_user.create_user.label_conf_pass')" type="password" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
@@ -34,7 +34,7 @@
<!--Email-->
<div class="block-wrapper">
<label>{{ $t('page_registration.label_email') }}</label>
<label>{{ $t('page_registration.label_email') }}:</label>
<div class="input-wrapper">
<input :value="user.data.attributes.email"
:placeholder="$t('page_registration.placeholder_email')"
@@ -46,7 +46,7 @@
<!--Name-->
<div class="block-wrapper">
<label>{{ $t('page_registration.label_name') }}</label>
<label>{{ $t('page_registration.label_name') }}:</label>
<div class="input-wrapper">
<input :value="user.data.attributes.name"
:placeholder="$t('page_registration.placeholder_name')"
@@ -7,13 +7,13 @@
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_create_password.title') }}</h1>
<h2>{{ $t('page_create_password.subtitle') }}</h2>
<h2>{{ $t('page_create_password.subtitle') }}:</h2>
<ValidationObserver @submit.prevent="createNewPassword" ref="create_new_password" v-slot="{ invalid }"
tag="form" class="form block-form create-new-password">
<div class="block-wrapper">
<label>{{ $t('page_create_password.label_email') }}</label>
<label>{{ $t('page_create_password.label_email') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="E-Mail" rules="required"
v-slot="{ errors }">
<input v-model="recoverPassword.email" :placeholder="$t('page_login.placeholder_email')" type="email"
@@ -7,7 +7,7 @@
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_forgotten_password.title') }}</h1>
<h2>{{ $t('page_forgotten_password.subtitle') }}</h2>
<h2>{{ $t('page_forgotten_password.subtitle') }}:</h2>
<ValidationObserver @submit.prevent="forgottenPassword" ref="forgotten_password" v-slot="{ invalid }"
tag="form" class="form inline-form">
+2 -2
View File
@@ -7,7 +7,7 @@
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_login.title') }}</h1>
<h2>{{ $t('page_login.subtitle') }}</h2>
<h2>{{ $t('page_login.subtitle') }}:</h2>
<ValidationObserver @submit.prevent="logIn" ref="log_in" v-slot="{ invalid }" tag="form"
class="form inline-form">
@@ -35,7 +35,7 @@
<div class="user" v-if="checkedAccount">
<img class="user-avatar" :src="checkedAccount.avatar" :alt="checkedAccount.name">
<h1>{{ $t('page_sign_in.title', {name: checkedAccount.name}) }}</h1>
<h2>{{ $t('page_sign_in.subtitle') }}</h2>
<h2>{{ $t('page_sign_in.subtitle') }}:</h2>
</div>
<ValidationObserver @submit.prevent="singIn" ref="sign_in" v-slot="{ invalid }" tag="form"
+5 -5
View File
@@ -7,13 +7,13 @@
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_registration.title') }}</h1>
<h2>{{ $t('page_registration.subtitle') }}</h2>
<h2>{{ $t('page_registration.subtitle') }}:</h2>
<ValidationObserver @submit.prevent="signUp" ref="sign_up" v-slot="{ invalid }" tag="form"
class="form block-form">
<div class="block-wrapper">
<label>{{ $t('page_registration.label_email') }}</label>
<label>{{ $t('page_registration.label_email') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="E-Mail" rules="required"
v-slot="{ errors }">
<input v-model="register.email" :placeholder="$t('page_registration.placeholder_email')" type="email"
@@ -23,7 +23,7 @@
</div>
<div class="block-wrapper">
<label>{{ $t('page_registration.label_name') }}</label>
<label>{{ $t('page_registration.label_name') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Full Name" rules="required"
v-slot="{ errors }">
<input v-model="register.name" :placeholder="$t('page_registration.placeholder_name')" type="text"
@@ -33,7 +33,7 @@
</div>
<div class="block-wrapper">
<label>{{ $t('page_registration.label_pass') }}</label>
<label>{{ $t('page_registration.label_pass') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Your New Password"
rules="required" v-slot="{ errors }">
<input v-model="register.password" :placeholder="$t('page_registration.placeholder_pass')" type="password"
@@ -43,7 +43,7 @@
</div>
<div class="block-wrapper">
<label>{{ $t('page_registration.label_confirm_pass') }}</label>
<label>{{ $t('page_registration.label_confirm_pass') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Confirm Your Password"
rules="required" v-slot="{ errors }">
<input v-model="register.password_confirmation" :placeholder="$t('page_registration.placeholder_confirm_pass')"
+1 -1
View File
@@ -45,7 +45,7 @@
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_shared.title') }}</h1>
<h2>{{ $t('page_shared.subtitle') }}</h2>
<h2>{{ $t('page_shared.subtitle') }}:</h2>
<ValidationObserver @submit.prevent="authenticateProtected" ref="authenticateProtected" v-slot="{ invalid }" tag="form" class="form inline-form">
+2 -2
View File
@@ -4,7 +4,7 @@
<div class="form block-form">
<FormLabel>{{ $t('user_settings.title_account') }}</FormLabel>
<div class="block-wrapper">
<label>{{ $t('page_registration.label_email') }}</label>
<label>{{ $t('page_registration.label_email') }}:</label>
<div class="input-wrapper">
<input :value="userInfo.email"
:placeholder="$t('page_registration.placeholder_email')"
@@ -14,7 +14,7 @@
</div>
</div>
<div class="block-wrapper">
<label>{{ $t('page_registration.label_name') }}</label>
<label>{{ $t('page_registration.label_name') }}:</label>
<div class="input-wrapper">
<input @keyup="changeUserName"
v-model="userInfo.name"
+45 -45
View File
@@ -1,66 +1,66 @@
<?php
return [
'app_description' => 'Your self-hosted storage cloud software powered by Laravel and Vue',
'user_not_fount' => _t('user_not_fount'),
'incorrect_password' => 'Sorry, your password is incorrect.',
'time' => '%d. %B. %Y at %H:%M',
'home' => 'Home',
'app_description' => __t('app_description'),
'user_not_fount' => __t('user_not_fount'),
'incorrect_password' => __t('incorrect_password'),
'time' => __t('time'),
'home' => __t('home'),
//Shared link email message
'shared_link_email_subject' => _t('shared_link_email_subject'),
'shared_link_email_greeting' => _t('shared_link_email_greeting'),
'shared_link_email_user' => _t('shared_link_email_user'),
'shared_link_email_link' => _t('shared_link_email_link'),
'shared_link_email_salutation' => _t('shared_link_email_salutation'),
'shared_link_email_subject' => __t('shared_link_email_subject'),
'shared_link_email_greeting' => __t('shared_link_email_greeting'),
'shared_link_email_user' => __t('shared_link_email_user'),
'shared_link_email_link' => __t('shared_link_email_link'),
'shared_link_email_salutation' => __t('shared_link_email_salutation'),
// Reset password email
'reset_password_greeting' => 'Hello!',
'reset_password_subject' => 'Reset password for your account on ',
'reset_password_line_1' => 'You are receiving this email because we received a password reset request for your account.',
'reset_password_line_2' => 'If you did not request a password reset, no further action is required.',
'reset_password_action' => 'Reset Password',
'reset_password_greeting' => __t('reset_password_greeting'),
'reset_password_subject' => __t('reset_password_subject'),
'reset_password_line_1' => __t('reset_password_line_1'),
'reset_password_line_2' => __t('reset_password_line_2'),
'reset_password_action' => __t('reset_password_action'),
'salutation' => 'Regards',
'salutation' => __t('salutation'),
// Invoice
'print_button' => 'Print Document',
'print_button' => __t('print_button'),
'vat' => 'VAT',
'vat_included' => 'incl.',
'subtotal' => 'Subtotal',
'vat' => __t('vat'),
'vat_included' => __t('vat_included'),
'subtotal' => __t('subtotal'),
'tax_exempted' => 'Tax is exempted',
'tax_be_paid_reverse' => 'Tax to be paid on reverse charge basis',
'tax_exempted' => __t('tax_exempted'),
'tax_be_paid_reverse' => __t('tax_be_paid_reverse'),
'invoice_title' => 'Invoice',
'date' => 'Date',
'product' => 'Product',
'subscription' => 'Subscription',
'invoice_number' => 'Invoice Number',
'invoice_title' => __t('invoice_title'),
'date' => __t('date'),
'product' => __t('product'),
'subscription' => __t('subscription'),
'invoice_number' => __t('invoice_number'),
'seller' => 'Seller',
'client' => 'Client',
'seller' => __t('seller'),
'client' => __t('client'),
'seller_vat' => 'VAT number',
'seller_name' => 'Name',
'seller_phone' => 'Phone',
'seller_vat' => __t('seller_vat'),
'seller_name' => __t('seller_name'),
'seller_phone' => __t('seller_phone'),
'name' => 'Name',
'phone' => 'Phone',
'address' => 'Address',
'city' => 'City',
'state' => 'State',
'postal_code' => 'Postal code',
'country' => 'Country',
'name' => __t('name'),
'phone' => __t('phone'),
'address' => __t('address'),
'city' => __t('city'),
'state' => __t('state'),
'postal_code' => __t('postal_code'),
'country' => __t('country'),
'col_description' => 'Description',
'col_date' => 'Date',
'col_amount' => 'Amount',
'col_description' => __t('col_description'),
'col_date' => __t('col_date'),
'col_amount' => __t('col_amount'),
'total' => 'Total',
'total' => __t('total'),
// OG Page
'user_sending' => ':name is sending you this file',
'protected_file' => 'This link is protected by password',
'user_sending' => __t('user_sending'),
'protected_file' => __t('protected_file'),
];