From 76417a0cbda785ded84cd46c52d0385d7fa8cf74 Mon Sep 17 00:00:00 2001 From: Luk Date: Tue, 16 Jan 2024 22:15:52 +0800 Subject: [PATCH] u --- unitool.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/unitool.js b/unitool.js index c18e396..7f60ff1 100644 --- a/unitool.js +++ b/unitool.js @@ -421,6 +421,7 @@ export default { }, open_url_in_browser (url) { + url = this.localizeText?.(url) || url // #ifdef APP-PLUS plus.runtime.openURL(url) // #endif @@ -635,7 +636,9 @@ export default { } }, - copy_to_clipboard (text, { promptLength = 50, hidePrompt = false, wo = globalThis.wo } = {}) { + copy_to_clipboard (text, { promptLength = 50, hidePrompt = false } = {}) { + text = this.localizeText?.(text) || text + const self = this uni.setClipboardData({ data: text, success: () => { @@ -644,9 +647,9 @@ export default { if (text.length > promptLength) { text = String(text).substring(0, promptLength) + ' ...' } - wo?.tt?.showToast?.({ + self.showToast?.({ type: 'success', - title: `${wo?.ll?.({ zhCN: '已成功拷贝', enUS: 'Successfully copied' })}\n${text}`, + title: `${this.localizeText?.({ zhCN: '已成功拷贝\n', enUS: 'Successfully copied\n' }) || ''}${text}`, }) } },