-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
140 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import VueI18n from "vue-i18n" | ||
import Vue from "vue" | ||
import enUS from "./lang/en-US" | ||
import zhCN from "./lang/zh-CN" | ||
import { getLocale } from "@/utils/i18n" | ||
|
||
Vue.use(VueI18n) | ||
|
||
const i18n = new VueI18n({ | ||
locale: getLocale(), | ||
messages: { | ||
"en-US": enUS, | ||
"zh-CN": zhCN | ||
} | ||
}) | ||
|
||
export default i18n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export default { | ||
home: 'Home', | ||
archives: 'Archives', | ||
inspiration: 'Inspiration', | ||
friends: 'Friends', | ||
about: 'About', | ||
enter_search: 'Enter keywords to search...', | ||
search: 'Search', | ||
recent_posts: 'Recent Posts', | ||
tags: 'Tags', | ||
clear_selection: 'Clear Selection', | ||
no_articles: 'There are no articles in this tag.', | ||
you_have_written: 'You have already written', | ||
keep_writing: 'articles, continue to persist!', | ||
tag_articles: 'There are', | ||
under_this_label: 'articles under this label.', | ||
ideas: 'Ideas', | ||
unblied_friends: 'Unblied friends', | ||
cannot_visit: 'Friends who can\'t visit', | ||
friend_info: 'My friend chain information', | ||
my_friends: 'My friends', | ||
exchange_link: 'Welcome everyone to exchange friend chain (づ ̄ 3 ̄)づ', | ||
this_is_my_friend: 'This is my friend chain information, everyone can follow this format to leave a message.', | ||
randomly_sorted: 'The following links will be randomly sorted, and I will periodically update the sorting and filter the list of deceased members.', | ||
own_storage_space: 'To ensure the visual experience of the page, the avatar will be saved to COS, if your avatar changed, please contact me to modify it.', | ||
please_restore: 'Please restore normal access to the website as soon as possible for the missing friends mentioned above, and notify me.', | ||
continue_include: 'If you need this blog to continue including your site, please add this site to your site and contact me.', | ||
comments: 'Comments', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export default { | ||
home: '首页', | ||
archives: '归档', | ||
inspiration: '灵感', | ||
friends: '友链', | ||
about: '关于', | ||
enter_search: '输入关键词进行搜索', | ||
search: '搜索', | ||
recent_posts: '近期文章', | ||
tags: '标签', | ||
clear_selection: '清除选中', | ||
no_articles: '该标签下暂时没有文章~', | ||
you_have_written: '你已经写了', | ||
keep_writing: '篇文章了,继续坚持哦~', | ||
tag_articles: '该标签下有', | ||
under_this_label: '篇文章~', | ||
ideas: '絮絮叨叨', | ||
unblied_friends: '未添加本站的小伙伴们', | ||
cannot_visit: '失联的小伙伴们', | ||
friend_info: '我的友链信息', | ||
my_friends: '小伙伴们', | ||
exchange_link: '欢迎各位大佬交换友链 (づ ̄ 3 ̄)づ', | ||
this_is_my_friend: '以下是我的友链信息,各位大佬可以在页面下按照这个格式留言', | ||
randomly_sorted: '以下友链友链随机排序,博主将不定期更新排序并过滤阵亡名单', | ||
own_storage_space: '为了页面视觉体验,头像将保存到博主自己的存储空间,如果有更新请即时联系博主修改', | ||
please_restore: '请以上失联的小伙伴尽快恢复网站的正常访问,并且通知博主', | ||
continue_include: '如果需要本博客继续收录您的站点,请于您的站点添加本站后联系博主', | ||
comments: '评论', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* 获取当前语言 | ||
* @returns {string} en-US | zh-CN | ||
*/ | ||
export function getLocale() { | ||
const checkForZh = (lang) => lang && lang.indexOf('zh') > -1 | ||
|
||
const localeFromStorage = localStorage.getItem('locale') | ||
if (checkForZh(localeFromStorage)) { | ||
document.documentElement.lang = 'zh-CN' | ||
return 'zh-CN' | ||
} else if (localeFromStorage) { | ||
document.documentElement.lang = 'en-US' | ||
return 'en-US' | ||
} | ||
|
||
if (navigator.language) { | ||
const language = checkForZh(navigator.language) ? 'zh-CN' : 'en-US' | ||
document.documentElement.lang = language | ||
return language | ||
} | ||
|
||
document.documentElement.lang = 'en-US' | ||
return 'en-US' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters