icon i18n

This commit is contained in:
Jesse-Ma
2022-12-02 17:58:20 +08:00
parent 49916b166e
commit 7fb00c8cf5
13 changed files with 24 additions and 144 deletions

View File

@@ -4,6 +4,7 @@ const en = {
},
content: {
blankTip: "I am Blank.",
noteTip: "Start writing something...",
},
button: {
ok: "OK",

View File

@@ -3,7 +3,8 @@ const zh = {
askTodelete: "是否确定要删除?",
},
content: {
blankTip: "I am Blank.",
blankTip: "空白的内容。",
noteTip: "开始写下一些东西吧。。。"
},
button: {
ok: "好的",

View File

@@ -5,20 +5,26 @@ Vue.use(VueI18n);
import zh from "./config/zh";
import en from "./config/en";
const messages = {
zh,
en,
}
const i18n = new VueI18n({
messages: messages,
locale: getLocale(),
messages: {
zh,
en,
},
});
function getLocale(){
if(localStorage.getItem("locale")){
return localStorage.getItem("locale").substring(0,2);
}
function getLocale() {
var lang = navigator.language;
if (lang) {
lang = lang.substring(0, 2);
}
return "en";
if (Object.keys(messages).indexOf(lang) >= 0) {
return lang;
}
return "en";
}
export default i18n;

View File

@@ -77,7 +77,7 @@
<Affix :offset-top="0">
<div style="background: white;width:100%;height:40px;">
<img style="height:40px;float:left;cursor: pointer;" alt="refresh flagnote" src="/static/favicon.png"
<img style="height:40px;float:left;cursor: pointer;" alt="refresh flagnote" src="/static/logo.png"
v-on:click="refreshPage()" />
<div style="float:left;width:auto;">
@@ -148,7 +148,7 @@
<Form :model="noteForm" :label-width="80">
<div id="wrapper" style="border-left: 0px solid #FF3366;">
<Input element-id="noteText" type="textarea" :border="false" v-model="noteForm.text" autofocus
:autosize="{ minRows: 30, maxRows: 20480 }" placeholder="Write something..." @input="recordText"
:autosize="{ minRows: 30, maxRows: 20480 }" :placeholder="$t('content.noteTip')" @input="recordText"
@on-keydown="recordEventKdown" />
</div>
</Form>

View File

@@ -1,5 +1,5 @@
<template>
<div class="home">
<div class="error">
error
</div>
</template>

View File

@@ -53,7 +53,7 @@
<Affix :offset-top="0">
<div style="background: white;width:100%;height:40px;">
<img style="height:40px;float:left;" src="/static/favicon.png">
<img style="height:40px;float:left;" src="/static/logo.png">
<div style="float:right;width:auto;">
<Button-group size="large">

View File

@@ -163,7 +163,7 @@
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
<Affix :offset-top="0">
<div style="background: white;width:100%;height:40px;">
<img style="height:40px;float:left;cursor: pointer;" alt="refresh flagnote" src="/static/favicon.png"
<img style="height:40px;float:left;cursor: pointer;" alt="refresh flagnote" src="/static/logo.png"
v-on:click="refreshPage()">
<div style="float:left;width:auto;">