icon i18n
This commit is contained in:
@@ -4,6 +4,7 @@ const en = {
|
||||
},
|
||||
content: {
|
||||
blankTip: "I am Blank.",
|
||||
noteTip: "Start writing something...",
|
||||
},
|
||||
button: {
|
||||
ok: "OK",
|
||||
|
||||
@@ -3,7 +3,8 @@ const zh = {
|
||||
askTodelete: "是否确定要删除?",
|
||||
},
|
||||
content: {
|
||||
blankTip: "I am Blank.",
|
||||
blankTip: "空白的内容。",
|
||||
noteTip: "开始写下一些东西吧。。。"
|
||||
},
|
||||
button: {
|
||||
ok: "好的",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<div class="error">
|
||||
error
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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;">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user