diff --git a/lib/lang/en-US.js b/lib/lang/en-US.js
index 5e02c979..00414875 100644
--- a/lib/lang/en-US.js
+++ b/lib/lang/en-US.js
@@ -29,7 +29,10 @@ export default {
VIEWS: 'Views',
COPYRIGHT_NOTICE: 'All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!',
RESULT_OF_SEARCH: 'Results Found',
- ARTICLE_DETAIL: 'Article Details'
+ ARTICLE_DETAIL: 'Article Details',
+ PASSWORD_ERROR: 'Password Error!',
+ ARTICLE_LOCK_TIPS: 'Please Enter the password:',
+ SUBMIT: 'Submit'
},
PAGINATION: {
PREV: 'Prev',
diff --git a/lib/lang/zh-CN.js b/lib/lang/zh-CN.js
index 915c1a9a..4417a270 100644
--- a/lib/lang/zh-CN.js
+++ b/lib/lang/zh-CN.js
@@ -31,7 +31,10 @@ export default {
VIEWS: '次查看',
COPYRIGHT_NOTICE: '本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。',
RESULT_OF_SEARCH: '篇搜索到的结果',
- ARTICLE_DETAIL: '文章详情'
+ ARTICLE_DETAIL: '文章详情',
+ PASSWORD_ERROR: '密码错误!',
+ ARTICLE_LOCK_TIPS: '文章已上锁,请输入访问密码',
+ SUBMIT: '提交'
},
PAGINATION: {
PREV: '上一页',
diff --git a/lib/lang/zh-TW.js b/lib/lang/zh-TW.js
index 087c7713..a7f648f4 100644
--- a/lib/lang/zh-TW.js
+++ b/lib/lang/zh-TW.js
@@ -31,7 +31,10 @@ export default {
VIEWS: '次查看',
COPYRIGHT_NOTICE: '本文採用 CC BY-NC-SA 4.0 許可協議,轉載請註明出處。',
RESULT_OF_SEARCH: '篇搜尋到的结果',
- ARTICLE_DETAIL: '完整文章'
+ ARTICLE_DETAIL: '完整文章',
+ PASSWORD_ERROR: '密碼錯誤!',
+ ARTICLE_LOCK_TIPS: '文章已上鎖,請輸入訪問密碼',
+ SUBMIT: '提交'
},
PAGINATION: {
PREV: '上一頁',
diff --git a/themes/empty/components/ArticleLock.js b/themes/empty/components/ArticleLock.js
index c9188165..bfdd00ce 100644
--- a/themes/empty/components/ArticleLock.js
+++ b/themes/empty/components/ArticleLock.js
@@ -1,3 +1,4 @@
+import { useGlobal } from '@/lib/global'
/**
* 加密文章校验组件
@@ -8,6 +9,8 @@
*/
export const ArticleLock = props => {
const { password, validPassword } = props
+ const { locale } = useGlobal()
+
const submitPassword = () => {
const p = document.getElementById('password')
if (p && p.value && p.value === password) {
@@ -16,18 +19,18 @@ export const ArticleLock = props => {
const tips = document.getElementById('tips')
if (tips) {
tips.innerHTML = ''
- tips.innerHTML = '
密码输入错误
'
+ tips.innerHTML = `${locale.COMMON.PASSWORD_ERROR}
`
}
}
}
return
-
文章已加锁,请输入访问密码:
+
{locale.COMMON.ARTICLE_LOCK_TIPS}
diff --git a/themes/fukasawa/components/ArticleLock.js b/themes/fukasawa/components/ArticleLock.js
index 6917b6c1..0d10b513 100644
--- a/themes/fukasawa/components/ArticleLock.js
+++ b/themes/fukasawa/components/ArticleLock.js
@@ -1,3 +1,5 @@
+import { useGlobal } from '@/lib/global'
+
/**
* 加密文章校验组件
* @param {password, validPassword} props
@@ -7,6 +9,8 @@
*/
export const ArticleLock = props => {
const { password, validPassword } = props
+ const { locale } = useGlobal()
+
const submitPassword = () => {
const p = document.getElementById('password')
if (p && p.value && p.value === password) {
@@ -15,8 +19,7 @@ export const ArticleLock = props => {
const tips = document.getElementById('tips')
if (tips) {
tips.innerHTML = ''
- tips.innerHTML =
- "
密码输入错误
"
+ tips.innerHTML = `
${locale.COMMON.PASSWORD_ERROR}
`
}
}
}
@@ -25,7 +28,7 @@ export const ArticleLock = props => {
-
文章已加锁,请输入访问密码:
+
{locale.COMMON.ARTICLE_LOCK_TIPS}
{
onClick={submitPassword}
className="px-3 whitespace-nowrap cursor-pointer items-center justify-center py-2 bg-gray-700 hover:bg-gray-400 text-white rounded-r duration-300"
>
-
- 提交
-
+ {locale.COMMON.SUBMIT}
diff --git a/themes/hexo/components/ArticleLock.js b/themes/hexo/components/ArticleLock.js
index 95b60749..71d2354f 100644
--- a/themes/hexo/components/ArticleLock.js
+++ b/themes/hexo/components/ArticleLock.js
@@ -1,3 +1,4 @@
+import { useGlobal } from '@/lib/global'
/**
* 加密文章校验组件
@@ -8,6 +9,7 @@
*/
export const ArticleLock = props => {
const { password, validPassword } = props
+ const { locale } = useGlobal()
const submitPassword = () => {
const p = document.getElementById('password')
if (p && p.value && p.value === password) {
@@ -16,18 +18,18 @@ export const ArticleLock = props => {
const tips = document.getElementById('tips')
if (tips) {
tips.innerHTML = ''
- tips.innerHTML = '
密码输入错误
'
+ tips.innerHTML = `
${locale.COMMON.PASSWORD_ERROR}
`
}
}
}
return
-
文章已加锁,请输入访问密码:
+
{locale.COMMON.ARTICLE_LOCK_TIPS}
diff --git a/themes/medium/components/ArticleLock.js b/themes/medium/components/ArticleLock.js
index 1b38febc..aba09687 100644
--- a/themes/medium/components/ArticleLock.js
+++ b/themes/medium/components/ArticleLock.js
@@ -1,3 +1,4 @@
+import { useGlobal } from '@/lib/global'
/**
* 加密文章校验组件
@@ -8,6 +9,8 @@
*/
export const ArticleLock = props => {
const { password, validPassword } = props
+ const { locale } = useGlobal()
+
const submitPassword = () => {
const p = document.getElementById('password')
if (p && p.value && p.value === password) {
@@ -16,18 +19,18 @@ export const ArticleLock = props => {
const tips = document.getElementById('tips')
if (tips) {
tips.innerHTML = ''
- tips.innerHTML = '
密码输入错误
'
+ tips.innerHTML = `
${locale.COMMON.PASSWORD_ERROR}
`
}
}
}
return
-
文章已加锁,请输入访问密码:
+
{locale.COMMON.ARTICLE_LOCK_TIPS}
diff --git a/themes/next/components/ArticleLock.js b/themes/next/components/ArticleLock.js
index baccc61c..b8132316 100644
--- a/themes/next/components/ArticleLock.js
+++ b/themes/next/components/ArticleLock.js
@@ -1,3 +1,5 @@
+import { useGlobal } from '@/lib/global'
+
/**
* 加密文章校验组件
* @param {password, validPassword} props
@@ -7,6 +9,8 @@
*/
export const ArticleLock = props => {
const { password, validPassword } = props
+ const { locale } = useGlobal()
+
const submitPassword = () => {
const p = document.getElementById('password')
if (p && p.value && p.value === password) {
@@ -15,8 +19,7 @@ export const ArticleLock = props => {
const tips = document.getElementById('tips')
if (tips) {
tips.innerHTML = ''
- tips.innerHTML =
- "
密码输入错误
"
+ tips.innerHTML = `
${locale.COMMON.PASSWORD_ERROR}
`
}
}
}
@@ -25,19 +28,17 @@ export const ArticleLock = props => {
-
文章已加锁,请输入访问密码:
+
{locale.COMMON.ARTICLE_LOCK_TIPS}