mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-03 00:33:13 +00:00
fix: localize English UI strings
This commit is contained in:
1 parent
d3acd8e96e
commit
6e54776509
24 files changed
+322
-196
No files matched your search
@@ -35,7 +35,7 @@
|
||||
class="toc-sidebar"
|
||||
>
|
||||
<div class="toc-header">
|
||||
<span class="toc-title">目录</span>
|
||||
<span class="toc-title">{{ t('customPage.tableOfContents') }}</span>
|
||||
<button class="toc-close-btn" @click="tocVisible = false">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 18l-6-6 6-6"/></svg>
|
||||
</button>
|
||||
@@ -64,7 +64,7 @@
|
||||
@click="tocVisible = true"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12h18M3 6h18M3 18h18"/></svg>
|
||||
<span class="ml-1 text-xs">目录</span>
|
||||
<span class="ml-1 text-xs">{{ t('customPage.tableOfContents') }}</span>
|
||||
</button>
|
||||
|
||||
<!-- Content -->
|
||||
@@ -317,16 +317,16 @@ function injectCopyButtons() {
|
||||
if (pre.querySelector('.copy-btn')) return
|
||||
const btn = document.createElement('button')
|
||||
btn.className = 'copy-btn'
|
||||
btn.textContent = '复制'
|
||||
btn.textContent = t('customPage.copyCode')
|
||||
btn.addEventListener('click', async () => {
|
||||
const code = pre.querySelector('code')?.textContent ?? pre.textContent ?? ''
|
||||
try {
|
||||
await navigator.clipboard.writeText(code)
|
||||
btn.textContent = '已复制 ✓'
|
||||
setTimeout(() => { btn.textContent = '复制' }, 2000)
|
||||
btn.textContent = t('customPage.copiedCode')
|
||||
setTimeout(() => { btn.textContent = t('customPage.copyCode') }, 2000)
|
||||
} catch {
|
||||
btn.textContent = '失败'
|
||||
setTimeout(() => { btn.textContent = '复制' }, 2000)
|
||||
btn.textContent = t('customPage.copyCodeFailed')
|
||||
setTimeout(() => { btn.textContent = t('customPage.copyCode') }, 2000)
|
||||
}
|
||||
})
|
||||
pre.style.position = 'relative'
|
||||
|
||||
Reference in new issue
Block a user