mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-15 23:31:15 +00:00
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:
committed by
GitHub
parent
6f52cb2ada
commit
58294a3c2a
@@ -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
|
||||
|
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"languages": {
|
||||
"de": "Deutsch"
|
||||
},
|
||||
"general": {
|
||||
"pagination": {
|
||||
"size": "Anzahl an Elementen",
|
||||
|
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"languages": {
|
||||
"en": "English"
|
||||
},
|
||||
"general": {
|
||||
"pagination": {
|
||||
"size": "Number of Elements",
|
||||
|
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"languages": {
|
||||
"ru": "Русский"
|
||||
},
|
||||
"general": {
|
||||
"pagination": {
|
||||
"size": "Количество элементов",
|
||||
|
Reference in New Issue
Block a user