Skip to content

Commit

Permalink
fix(i18n): copy feat i18n for service manual prompt (#2532)
Browse files Browse the repository at this point in the history
  • Loading branch information
3gf8jv4dv authored Feb 4, 2025
1 parent bbd903a commit 7861285
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ type CopyToClipboardButtonProps = {
}

function CopyToClipboardButton({ onClick }: CopyToClipboardButtonProps) {
const { t } = useTranslation()
return (
<Tooltip
title="Copy to clipboard"
title={t('Copy to clipboard')}
placement="top"
slotProps={{
popper: {
Expand Down Expand Up @@ -96,14 +97,14 @@ export default function ServerManualPromptDialog({
.then(() => {
console.log('copied')
notification({
title: t('Copy to clipboard'),
title: `Clash Nyanpasu - ${t('Service Manual Tips')}`,
body: t('Copied to clipboard'),
})
})
.catch((error) => {
console.error(error)
notification({
title: t('Copy to clipboard'),
title: `Clash Nyanpasu - ${t('Service Manual Tips')}`,
body: t('Failed to copy to clipboard'),
})
})
Expand Down
3 changes: 3 additions & 0 deletions frontend/nyanpasu/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@
"UI": "UI",
"Service Manual Tips": "Service Manual Tips",
"Unable to operation the service automatically": "Unable to {{operation}} the service automatically. Please navigate to the core directory, run PowerShell as administrator on Windows or a terminal emulator on macOS/Linux, and execute the following commands:",
"Copy to clipboard": "Copy to clipboard",
"Copied to clipboard": "Copied to clipboard~",
"Failed to copy to clipboard": "Failed to copy to clipboard!",
"Successfully switched to the clash core": "Successfully switched to the {{core}} core.",
"Failed to switch. You could see the details in the log": "Failed to switch. You could see the details in the log. \nError: {{error}}",
"Successfully restarted the core": "Successfully restarted the core.",
Expand Down
3 changes: 3 additions & 0 deletions frontend/nyanpasu/src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@
"UI": "Пользовательский интерфейс",
"Service Manual Tips": "Руководство по обслуживанию",
"Unable to operation the service automatically": "Не удается автоматически {{operation}} службу. Пожалуйста, перейдите в каталог ядра, запустите PowerShell как администратор на Windows или эмулятор терминала на macOS/Linux и выполните следующие команды:",
"Copy to clipboard": "Копировать в буфер обмена",
"Copied to clipboard": "Копируется в буфер обмена~",
"Failed to copy to clipboard": "Не удалось копировать в буфер обмена!",
"Successfully switched to the clash core": "Успешно переключено на ядро {{core}}.",
"Failed to switch. You could see the details in the log": "Не удалось переключить. Вы можете увидеть детали в журнале. \nОшибка: {{error}}",
"Successfully restarted the core": "Ядро успешно перезапущено.",
Expand Down
3 changes: 3 additions & 0 deletions frontend/nyanpasu/src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@
"Service Manual Tips": "有关服务的提示",
"Unable to operation the service automatically": "无法自动{{operation}}服务。请导航到内核所在目录,在 Windows 上以管理员身份打开 PowerShell 或在 macOS/Linux 上打开终端仿真器,然后执行以下命令:",
"Successfully switched to the clash core": "成功切换至 {{core}} 内核。",
"Copy to clipboard": "复制到剪贴板",
"Copied to clipboard": "已复制到剪贴板~",
"Failed to copy to clipboard": "复制失败!",
"Failed to switch. You could see the details in the log": "切换失败,可以在日志中查看详细信息。\n错误:{{error}}",
"Successfully restarted the core": "重启内核成功。",
"Failed to restart. You could see the details in the log": "重启失败,详细信息请检查日志。\n\n错误:",
Expand Down
3 changes: 3 additions & 0 deletions frontend/nyanpasu/src/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@
"UI": "使用者介面",
"Service Manual Tips": "有關服務的提示",
"Unable to operation the service automatically": "無法自動{{operation}}服務。請開啟核心所在目錄,在 Windows 上以管理員身分開啟 PowerShell 或在 macOS/Linux 上開啟終端模擬器,然後執行以下指令:",
"Copy to clipboard": "複製到剪貼簿",
"Copied to clipboard": "已複製到剪貼簿~",
"Failed to copy to clipboard": "複製失敗!",
"Successfully switched to the clash core": "成功切換至「{{core}}」核心。",
"Failed to switch. You could see the details in the log": "切換失敗,可以在日誌中查看詳細資訊。\n錯誤:{{error}}",
"Successfully restarted the core": "成功重啟核心。",
Expand Down

0 comments on commit 7861285

Please sign in to comment.