@@ -112,11 +121,11 @@ export default function OAuthStep2() {
>
{buttonLoading ? (
<>
-
>
) : (
<>
-
>
)}
diff --git a/pages/onedrive-vercel-index-oauth/step-3.tsx b/pages/onedrive-vercel-index-oauth/step-3.tsx
index d27a8a5..98bc6dd 100644
--- a/pages/onedrive-vercel-index-oauth/step-3.tsx
+++ b/pages/onedrive-vercel-index-oauth/step-3.tsx
@@ -3,6 +3,7 @@ import Image from 'next/image'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
+import { useTranslation, Trans } from 'next-i18next'
import siteConfig from '../../config/site.config'
import Navbar from '../../components/Navbar'
@@ -15,6 +16,8 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
const router = useRouter()
const [expiryTimeLeft, setExpiryTimeLeft] = useState(expiryTime)
+ const { t } = useTranslation()
+
useEffect(() => {
if (!expiryTimeLeft) return
@@ -27,7 +30,7 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
const [buttonContent, setButtonContent] = useState(
)
const [buttonError, setButtonError] = useState(false)
@@ -36,7 +39,7 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
setButtonError(false)
setButtonContent(
)
@@ -46,7 +49,7 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
setButtonError(true)
setButtonContent(
)
return
@@ -55,7 +58,7 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
setButtonError(true)
setButtonContent(
)
return
@@ -66,7 +69,7 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
setButtonError(false)
setButtonContent(
)
setTimeout(() => {
@@ -77,7 +80,7 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
setButtonError(true)
setButtonContent(
)
})
@@ -86,7 +89,7 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
return (
-
Success! The API returned what we needed.
+
{t('Success! The API returned what we needed.')}
{accessToken && (
-
{' '}
- Acquired access_token:{' '}
+ {t('Acquired access_token: ')}
{`${accessToken.substring(0, 60)}...`}
@@ -157,7 +172,7 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
-
{' '}
- Acquired refresh_token:{' '}
+ {t('Acquired refresh_token: ')}
{`${refreshToken.substring(0, 60)}...`}
@@ -165,15 +180,22 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
- These tokens may take a few seconds to
- populate after you click the button below. If you go back home and still see the welcome page telling
- you to re-authenticate, revisit home and do a hard refresh.
+ {' '}
+ {t('These tokens may take a few seconds to populate after you click the button below. ') +
+ t('If you go back home and still see the welcome page telling you to re-authenticate, ') +
+ t('revisit home and do a hard refresh.')}
- Final step, click the button below to store these tokens persistently before they expire after{' '}
- {Math.floor(expiryTimeLeft / 60)} minutes {expiryTimeLeft - Math.floor(expiryTimeLeft / 60) * 60}{' '}
- seconds. Don't worry, after storing them, onedrive-vercel-index will take care of token refreshes
- and updates after your site goes live.
+ {t(
+ 'Final step, click the button below to store these tokens persistently before they expire after {{minutes}} minutes {{seconds}} seconds. ',
+ {
+ minutes: Math.floor(expiryTimeLeft / 60),
+ seconds: expiryTimeLeft - Math.floor(expiryTimeLeft / 60) * 60
+ }
+ ) +
+ t(
+ 'Don't worry, after storing them, onedrive-vercel-index will take care of token refreshes and updates after your site goes live.'
+ )}
diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index 57ccfd7..3253f8f 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -3,9 +3,18 @@
"- showing {{count}} page(s) ——other": "- showing {{count}} pages ",
"{{count}} item(s)——one": "{{count}} item",
"{{count}} item(s)——other": "{{count}} items",
+ "<0>0> If you are not the owner of this website, stop now, as continuing with this process may expose your personal files in OneDrive.": "<0>0> If you are not the owner of this website, stop now, as continuing with this process may expose your personal files in OneDrive.",
+ "<0>0> If you have not specified a REDIS_URL inside your Vercel env variable, go initialise one at <3>Upstash3>. Docs: <6>Vercel Integration - Upstash6>.": "<0>0> If you have not specified a REDIS_URL inside your Vercel env variable, go initialise one at <3>Upstash3>. Docs: <6>Vercel Integration - Upstash6>.",
+ "<0>0> If you see anything missing or incorrect, you need to reconfigure <3>/config/api.json3> and redeploy this instance.": "<0>0> If you see anything missing or incorrect, you need to reconfigure <3>/config/api.json3> and redeploy this instance.",
+ "✅ You can now proceed onto the next step: requesting your access token and refresh token.": "✅ You can now proceed onto the next step: requesting your access token and refresh token.",
+ "❌ No valid code extracted.": "❌ No valid code extracted.",
+ "Acquired access_token: ": "Acquired access_token: ",
+ "Acquired refresh_token: ": "Acquired refresh_token: ",
"Actions": "Actions",
+ "Authorisation is required as no valid <2>access_token2> or <5>refresh_token5> is present on this deployed instance. Check the following configurations before proceeding with authorising onedrive-vercel-index with your own Microsoft account.": "Authorisation is required as no valid <2>access_token2> or <5>refresh_token5> is present on this deployed instance. Check the following configurations before proceeding with authorising onedrive-vercel-index with your own Microsoft account.",
"Cancel": "Cancel",
"Cannot preview {{path}}": "Cannot preview {{path}}",
+ "Check out <2>Microsoft's official explanation2> on the error message.": "Check out <2>Microsoft's official explanation2> on the error message.",
"Clear all": "Clear all",
"Clear all tokens?": "Clear all tokens?",
"Cleared all tokens": "Cleared all tokens",
@@ -17,6 +26,8 @@
"Copy folder permalink": "Copy folder permalink",
"Copy raw file permalink": "Copy raw file permalink",
"Copy the permalink to the file to the clipboard": "Copy the permalink to the file to the clipboard",
+ "Do not pretend to be the site owner": "Do not pretend to be the site owner",
+ "Don't worry, after storing them, onedrive-vercel-index will take care of token refreshes and updates after your site goes live.": "Don't worry, after storing them, onedrive-vercel-index will take care of token refreshes and updates after your site goes live.",
"Download": "Download",
"Download file": "Download file",
"Download folder": "Download folder",
@@ -28,17 +39,22 @@
"Downloading selected files...": "Downloading selected files...",
"Email": "Email",
"Enter Password": "Enter Password",
+ "Error storing the token": "Error storing the token",
+ "Error validating identify, restart": "Error validating identify, restart",
"Error: {{message}}": "Error: {{message}}",
"Failed to download folder {{path}}: {{status}} {{message}} Skipped it to continue.": "Failed to download folder {{path}}: {{status}} {{message}} Skipped it to continue.",
"Failed to download folder.": "Failed to download folder.",
"Failed to download selected files.": "Failed to download selected files.",
"File is empty.": "File is empty.",
"File size": "File size",
+ "Final step, click the button below to store these tokens persistently before they expire after {{minutes}} minutes {{seconds}} seconds. ": "Final step, click the button below to store these tokens persistently before they expire after {{minutes}} minutes {{seconds}} seconds. ",
"Finished downloading folder.": "Finished downloading folder.",
"Finished downloading selected files.": "Finished downloading selected files.",
+ "Get tokens": "Get tokens",
"Grid": "Grid",
"Hashes": "Hashes",
"Home": "Home",
+ "If you go back home and still see the welcome page telling you to re-authenticate, ": "If you go back home and still see the welcome page telling you to re-authenticate, ",
"If you know the password, please enter it below.": "If you know the password, please enter it below.",
"Last modified": "Last modified",
"Last Modified": "Last Modified",
@@ -53,6 +69,9 @@
"Name": "Name",
"No more files": "No more files",
"Nothing here.": "Nothing here.",
+ "OAuth Step 1 - {{title}}": "OAuth Step 1 - {{title}}",
+ "OAuth Step 2 - {{title}}": "OAuth Step 2 - {{title}}",
+ "OAuth Step 3 - {{title}}": "OAuth Step 3 - {{title}}",
"of {{count}} file(s) -——loaded——one": "of {{count}} file -",
"of {{count}} file(s) -——loaded——other": "of {{count}} files -",
"of {{count}} file(s) -——loading——one": "of ... file(s) -",
@@ -61,13 +80,31 @@
"Open URL": "Open URL",
"Open URL{{url}}": "Open URL{{url}}",
"Press <2>F122> and open devtools for more details, or seek help at <6>onedrive-vercel-index discussions6>.": "Press <2>F122> and open devtools for more details, or seek help at <6>onedrive-vercel-index discussions6>.",
+ "Proceed to OAuth": "Proceed to OAuth",
+ "Requesting tokens": "Requesting tokens",
+ "Restart": "Restart",
+ "revisit home and do a hard refresh.": "revisit home and do a hard refresh.",
"Search ...": "Search ...",
"Select all files": "Select all files",
"Select file": "Select file",
"Select files": "Select files",
"Size": "Size",
+ "Step 1/3: Preparations": "Step 1/3: Preparations",
+ "Step 2/3: Get authorisation code": "Step 2/3: Get authorisation code",
+ "Step 3/3: Get access and refresh tokens": "Step 3/3: Get access and refresh tokens",
+ "Store tokens": "Store tokens",
+ "Stored! Going home...": "Stored! Going home...",
+ "Storing tokens": "Storing tokens",
+ "Success! The API returned what we needed.": "Success! The API returned what we needed.",
+ "The authorisation code extracted is:": "The authorisation code extracted is:",
+ "The OAuth link for getting the authorisation code has been created. Click on the link above to get the <2>authorisation code2>. Your browser will open a new tab to Microsoft's account login page. After logging in and authenticating with your Microsoft account, you will be redirected to a blank page on localhost. Paste <5>the entire redirected URL5> down below.": "The OAuth link for getting the authorisation code has been created. Click on the link above to get the <2>authorisation code2>. Your browser will open a new tab to Microsoft's account login page. After logging in and authenticating with your Microsoft account, you will be redirected to a blank page on localhost. Paste <5>the entire redirected URL5> down below.",
"These tokens are used to authenticate yourself into password protected folders, ": "These tokens are used to authenticate yourself into password protected folders, ",
+ "These tokens may take a few seconds to populate after you click the button below. ": "These tokens may take a few seconds to populate after you click the button below. ",
"This route (the folder itself and the files inside) is password protected. ": "This route (the folder itself and the files inside) is password protected. ",
"Unavailable": "Unavailable",
- "Weibo": "Weibo"
+ "Waiting for code...": "Waiting for code...",
+ "Weibo": "Weibo",
+ "Welcome to your new onedrive-vercel-index 🎉": "Welcome to your new onedrive-vercel-index 🎉",
+ "Where is the auth code? Did you follow step 2 you silly donut?": "Where is the auth code? Did you follow step 2 you silly donut?",
+ "Whoops, looks like we got a problem: {{error}}.": "Whoops, looks like we got a problem: {{error}}."
}
diff --git a/public/locales/zh-CN/common.json b/public/locales/zh-CN/common.json
index 0d0cdfd..3bb6e6c 100644
--- a/public/locales/zh-CN/common.json
+++ b/public/locales/zh-CN/common.json
@@ -1,9 +1,18 @@
{
"- showing {{count}} page(s) ——other": "已显示 {{count}} 页",
"{{count}} item(s)——other": "{{count}} 个项目",
+ "<0>0> If you are not the owner of this website, stop now, as continuing with this process may expose your personal files in OneDrive.": "<0>0> 如果你不是这个网站的所有者,请立即停止操作,因为继续操作可能会暴露你的 OneDrive 私人文件。",
+ "<0>0> If you have not specified a REDIS_URL inside your Vercel env variable, go initialise one at <3>Upstash3>. Docs: <6>Vercel Integration - Upstash6>.": "<0>0> 如果你还没有在 Vercel 中设置环境变量 REDIS_URL,也可以从 <3>Upstash3> 处获取一个来使用。文档:<6>Vercel 集成 - Upstash6>。",
+ "<0>0> If you see anything missing or incorrect, you need to reconfigure <3>/config/api.json3> and redeploy this instance.": "<0>0> 如果你看到有遗漏或是错误的,你需要重新编辑 <3>/config/api.json3> 并重新部署这个实例。",
+ "✅ You can now proceed onto the next step: requesting your access token and refresh token.": "✅ 你现在可以进行下一步了:获取你的 access token 和 refresh token。",
+ "❌ No valid code extracted.": "❌ 提取出了无效的授权码。",
+ "Acquired access_token: ": "获取 access_token",
+ "Acquired refresh_token: ": "获取 refresh_token",
"Actions": "操作",
+ "Authorisation is required as no valid <2>access_token2> or <5>refresh_token5> is present on this deployed instance. Check the following configurations before proceeding with authorising onedrive-vercel-index with your own Microsoft account.": "此次部署收到了无效的 <2>access_token2> 和 <5>refresh_token5> 而无法完成授权。在继续对 onedrive-vercel-index 授权你的 Microsoft 帐号前,请检查一下下方的配置信息。",
"Cancel": "取消",
"Cannot preview {{path}}": "无法预览 {{path}}",
+ "Check out <2>Microsoft's official explanation2> on the error message.": "请查阅 <2>Microsoft 官方解释2> 以获取详细的错误信息。",
"Clear all": "清楚所有密钥",
"Clear all tokens?": "清楚所有密钥?",
"Cleared all tokens": "已清楚所有密钥",
@@ -15,6 +24,8 @@
"Copy folder permalink": "复制文件夹永久链接",
"Copy raw file permalink": "复制文件永久链接",
"Copy the permalink to the file to the clipboard": "复制文件永久链接到剪贴板",
+ "Do not pretend to be the site owner": "不要假装网站所有者",
+ "Don't worry, after storing them, onedrive-vercel-index will take care of token refreshes and updates after your site goes live.": "别担心,存储它们之后,onedrive-vercel-index 会在网站运行中自行维护 token 更新",
"Download": "下载",
"Download file": "下载此文件",
"Download folder": "下载此文件夹",
@@ -26,17 +37,22 @@
"Downloading selected files...": "下载选定文件中……",
"Email": "电子邮件",
"Enter Password": "输入密码",
+ "Error storing the token": "存储 token 时出错",
+ "Error validating identify, restart": "校验身份出错,需要重新开始",
"Error: {{message}}": "错误:{{message}}",
"Failed to download folder {{path}}: {{status}} {{message}} Skipped it to continue.": "下载文件夹 {{path}} 失败:{{status}} {{message}} 已忽略此错误并继续下载。",
"Failed to download folder.": "下载文件夹失败。",
"Failed to download selected files.": "下载选定文件失败。",
"File is empty.": "文件为空。",
"File size": "文件大小",
+ "Final step, click the button below to store these tokens persistently before they expire after {{minutes}} minutes {{seconds}} seconds. ": "最后一步,在这些 tokens 于 {{minutes}} 分钟 {{seconds}} 秒后失效前,点击下方按钮以永久存储这些 tokens",
"Finished downloading folder.": "下载文件夹成功。",
"Finished downloading selected files.": "下载选定文件成功。",
+ "Get tokens": "获取 tokens",
"Grid": "图格",
"Hashes": "哈希值",
"Home": "首页",
+ "If you go back home and still see the welcome page telling you to re-authenticate, ": "如果你回到首页却仍然发现欢迎界面在提示你重新认证,",
"If you know the password, please enter it below.": "如果您知晓密码,请在下面输入。",
"Last modified": "最后修改时间",
"Last Modified": "最后修改时间",
@@ -51,19 +67,40 @@
"Name": "文件名",
"No more files": "加载完毕",
"Nothing here.": "无内容。",
+ "OAuth Step 1 - {{title}}": "OAuth 第 1 步 - {{title}}",
+ "OAuth Step 2 - {{title}}": "OAuth 第 2 步 - {{title}}",
+ "OAuth Step 3 - {{title}}": "OAuth 第 3 步 - {{title}}",
"of {{count}} file(s) -——loaded——other": "共 {{count}} 个文件",
"of {{count}} file(s) -——loading——other": "共……个文件",
"Oops, that's a <1>four-oh-four1>.": "Oops,这里是 <1>4041> 页面。",
"Open URL": "打开 URL",
"Open URL{{url}}": "打开 URL{{url}}",
"Press <2>F122> and open devtools for more details, or seek help at <6>onedrive-vercel-index discussions6>.": "请按下 <2>F122> 来打开开发者工具窗口以获取详细信息,或是到 <6>onedrive-vercel-index 社区讨论6> 处寻求帮助。",
+ "Proceed to OAuth": "继续进行 OAuth",
+ "Requesting tokens": "获取 tokens",
+ "Restart": "重新开始",
+ "revisit home and do a hard refresh.": "重新访问首页并进行一次浏览器刷新",
"Search ...": "搜索……",
"Select all files": "选择所有文件",
"Select file": "选择此文件",
"Select files": "选择以下文件",
"Size": "文件大小",
+ "Step 1/3: Preparations": "步骤 1/3:准备",
+ "Step 2/3: Get authorisation code": "步骤 2/3:获取授权码",
+ "Step 3/3: Get access and refresh tokens": "步骤 3/3:获取 access token 和 refresh token",
+ "Store tokens": "储存 tokens",
+ "Stored! Going home...": "已存储!回到首页……",
+ "Storing tokens": "正在存储 tokens……",
+ "Success! The API returned what we needed.": "成功!此 API 返回了我们需要的东西。",
+ "The authorisation code extracted is:": "提取出的授权码为:",
+ "The OAuth link for getting the authorisation code has been created. Click on the link above to get the <2>authorisation code2>. Your browser will open a new tab to Microsoft's account login page. After logging in and authenticating with your Microsoft account, you will be redirected to a blank page on localhost. Paste <5>the entire redirected URL5> down below.": "创建出的这个 OAuth 链接是用来获取授权码的。点击下方链接以获取所需的 <2>授权码2>。你的浏览器将打开一个新的标签页到 Microsoft 的帐号登录页面。在登录并验证你的 Microsoft 帐号之后,你将被重定向到一个域名为 localhost 的空白页面。请将<5>完整的重定向后的 URL5> 复制粘贴到下方。",
"These tokens are used to authenticate yourself into password protected folders, ": "这些密钥是用来验证您的身份以访问密钥保护下的文件夹的,",
+ "These tokens may take a few seconds to populate after you click the button below. ": "当你点击下方按钮之后,这些 tokens 可能需要几秒钟来生成出现。",
"This route (the folder itself and the files inside) is password protected. ": "此路由(此文件夹和其中的文件)是受密钥保护的。",
"Unavailable": "无",
- "Weibo": "微博"
+ "Waiting for code...": "等待授权码……",
+ "Weibo": "微博",
+ "Welcome to your new onedrive-vercel-index 🎉": "欢迎来到你崭新的 onedrive-vercel-index 🎉",
+ "Where is the auth code? Did you follow step 2 you silly donut?": "授权码在哪里?你遵守了第 2 步吗?你这个傻瓜甜甜圈!o( ̄ヘ ̄o#)",
+ "Whoops, looks like we got a problem: {{error}}.": "Whoops,看来我们遇到了一个问题:{{error}}"
}