QoL frontend improvements (#267)

* refactor: add space for language title

* feat: add overflow-break to text-wrap class

* feat: add public key text wrapping for interfaces

* refactor: get rid of getlang function and set locale during initialization

fix: show english flag when locale does not match

* refactor: bind header logo alt attribute to companyName

* refactor: add language name to german

* refactor: add language name to russian

* refactor: add language name to english
This commit is contained in:
Ryazanov Alexander Mihailovich
2024-07-04 23:40:16 +03:00
committed by GitHub
parent 6f52cb2ada
commit 58294a3c2a
7 changed files with 30 additions and 18 deletions

View File

@@ -4,20 +4,16 @@ import ru from './translations/ru.json';
import en from './translations/en.json';
import {createI18n} from "vue-i18n";
function getStoredLanguage() {
let initialLang = localStorage.getItem('wgLang');
if (!initialLang) {
initialLang = "en"
}
return initialLang
}
// Create i18n instance with options
const i18n = createI18n({
legacy: false,
globalInjection: true,
allowComposition: true,
locale: getStoredLanguage(), // set locale
locale: (
localStorage.getItem('wgLang')
|| (window && window.navigator && (window.navigator.userLanguage || window.navigator.language).split('-')[0])
|| 'en'
), // set locale
fallbackLocale: "en", // set fallback locale
messages: {
"de": de,
@@ -26,4 +22,4 @@ const i18n = createI18n({
}
});
export default i18n
export default i18n

View File

@@ -1,4 +1,7 @@
{
"languages": {
"de": "Deutsch"
},
"general": {
"pagination": {
"size": "Anzahl an Elementen",

View File

@@ -1,4 +1,7 @@
{
"languages": {
"en": "English"
},
"general": {
"pagination": {
"size": "Number of Elements",

View File

@@ -1,4 +1,7 @@
{
"languages": {
"ru": "Русский"
},
"general": {
"pagination": {
"size": "Количество элементов",