mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 13:38:45 +00:00
add trans support and hook all compnents excluding preview dir
This commit is contained in:
+15
-9
@@ -47,7 +47,7 @@ const Navbar = () => {
|
||||
localStorage.removeItem(r)
|
||||
})
|
||||
|
||||
toast.success('Cleared all tokens')
|
||||
toast.success(t('Cleared all tokens'))
|
||||
setTimeout(() => {
|
||||
router.reload()
|
||||
}, 1000)
|
||||
@@ -95,14 +95,20 @@ const Navbar = () => {
|
||||
className="flex items-center space-x-2 hover:opacity-80 dark:text-white"
|
||||
>
|
||||
<FontAwesomeIcon icon={['fab', l.name.toLowerCase() as IconName]} />
|
||||
<span className="hidden text-sm font-medium md:inline-block">{l.name}</span>
|
||||
<span className="hidden text-sm font-medium md:inline-block">
|
||||
{
|
||||
// Append link name comments here to add translations
|
||||
// t('Weibo')
|
||||
t(l.name)
|
||||
}
|
||||
</span>
|
||||
</a>
|
||||
))}
|
||||
|
||||
{siteConfig.email && (
|
||||
<a href={siteConfig.email} className="flex items-center space-x-2 hover:opacity-80 dark:text-white">
|
||||
<FontAwesomeIcon icon={['far', 'envelope']} />
|
||||
<span className="hidden text-sm font-medium md:inline-block">Email</span>
|
||||
<span className="hidden text-sm font-medium md:inline-block">{t('Email')}</span>
|
||||
</a>
|
||||
)}
|
||||
|
||||
@@ -111,7 +117,7 @@ const Navbar = () => {
|
||||
className="flex items-center space-x-2 p-2 hover:opacity-80 dark:text-white"
|
||||
onClick={() => setIsOpen(true)}
|
||||
>
|
||||
<span className="text-sm font-medium">Logout</span>
|
||||
<span className="text-sm font-medium">{t('Logout')}</span>
|
||||
<FontAwesomeIcon icon="sign-out-alt" />
|
||||
</button>
|
||||
)}
|
||||
@@ -148,12 +154,12 @@ const Navbar = () => {
|
||||
>
|
||||
<div className="my-8 inline-block w-full max-w-md transform overflow-hidden rounded-lg bg-white p-6 text-left align-middle transition-all dark:bg-gray-900">
|
||||
<Dialog.Title className="text-lg font-bold text-gray-900 dark:text-gray-100">
|
||||
Clear all tokens?
|
||||
{t('Clear all tokens?')}
|
||||
</Dialog.Title>
|
||||
<div className="mt-2">
|
||||
<p className="text-sm text-gray-500">
|
||||
These tokens are used to authenticate yourself into password protected folders, clearing them means
|
||||
that you will need to re-enter the passwords again.
|
||||
{t('These tokens are used to authenticate yourself into password protected folders, ') +
|
||||
t('clearing them means that you will need to re-enter the passwords again.')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -171,14 +177,14 @@ const Navbar = () => {
|
||||
className="mr-3 inline-flex items-center justify-center space-x-2 rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-400 focus:outline-none focus:ring focus:ring-blue-300"
|
||||
onClick={() => setIsOpen(false)}
|
||||
>
|
||||
Cancel
|
||||
{t('Cancel')}
|
||||
</button>
|
||||
<button
|
||||
className="inline-flex items-center justify-center space-x-2 rounded bg-red-500 px-4 py-2 text-white hover:bg-red-400 focus:outline-none focus:ring focus:ring-red-300"
|
||||
onClick={() => clearTokens()}
|
||||
>
|
||||
<FontAwesomeIcon icon={['far', 'trash-alt']} />
|
||||
<span>Clear all</span>
|
||||
<span>{t('Clear all')}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user