diff --git a/src/core/helpers/i18n/en.json b/src/core/helpers/i18n/en.json index 0fff99ec4347489415a6b825af4c91f67e6b9736..809a405245152bb2d745762d74c19f0d722c6201 100644 --- a/src/core/helpers/i18n/en.json +++ b/src/core/helpers/i18n/en.json @@ -15,6 +15,7 @@ "uni.previewImage.button.save": "Save Image", "uni.previewImage.save.success": "Saved successfully", "uni.previewImage.save.fail": "Save failed", + "uni.setClipboardData.success": "Content copied", "uni.picker.done": "Done", "uni.picker.cancel": "Cancel", "uni.video.danmu": "Danmu", diff --git a/src/core/helpers/i18n/es.json b/src/core/helpers/i18n/es.json index 6d6d18936f121f847b44b384e84047434487995a..2de7144275cf500b384eda301022e27c3078947f 100644 --- a/src/core/helpers/i18n/es.json +++ b/src/core/helpers/i18n/es.json @@ -15,6 +15,7 @@ "uni.previewImage.button.save": "Guardar imagen", "uni.previewImage.save.success": "Guardado exitosamente", "uni.previewImage.save.fail": "Error al guardar", + "uni.setClipboardData.success": "Contenido copiado", "uni.picker.done": "OK", "uni.picker.cancel": "Cancelar", "uni.video.danmu": "Danmu", diff --git a/src/core/helpers/i18n/fr.json b/src/core/helpers/i18n/fr.json index 8d2d187a7797c14f0607500886bb78cb1c8a7151..a13aca88fe4b0ed5b06a692737ac87f9101d8340 100644 --- a/src/core/helpers/i18n/fr.json +++ b/src/core/helpers/i18n/fr.json @@ -15,6 +15,7 @@ "uni.previewImage.button.save": "Guardar imagen", "uni.previewImage.save.success": "Enregistré avec succès", "uni.previewImage.save.fail": "Échec de la sauvegarde", + "uni.setClipboardData.success": "Contenu copié", "uni.picker.done": "OK", "uni.picker.cancel": "Annuler", "uni.video.danmu": "Danmu", diff --git a/src/core/helpers/i18n/zh-Hans.json b/src/core/helpers/i18n/zh-Hans.json index 2de28d74b1fc8be00b1d73cca98cbcf1c2a6752d..4d577fe0db51b1d1d79722e9f80a79fc4f4ec921 100644 --- a/src/core/helpers/i18n/zh-Hans.json +++ b/src/core/helpers/i18n/zh-Hans.json @@ -15,6 +15,7 @@ "uni.previewImage.button.save": "保存图像", "uni.previewImage.save.success": "保存图像到相册成功", "uni.previewImage.save.fail": "保存图像到相册失败", + "uni.setClipboardData.success": "内容已复制", "uni.picker.done": "完成", "uni.picker.cancel": "取消", "uni.video.danmu": "弹幕", diff --git a/src/core/helpers/i18n/zh-Hant.json b/src/core/helpers/i18n/zh-Hant.json index 8e8ac2e644f024be3419b420c250659371a637da..15818f520939543f52b1a9f1da7497086533e2c9 100644 --- a/src/core/helpers/i18n/zh-Hant.json +++ b/src/core/helpers/i18n/zh-Hant.json @@ -15,6 +15,7 @@ "uni.previewImage.button.save": "保存圖像", "uni.previewImage.save.success": "保存圖像到相冊成功", "uni.previewImage.save.fail": "保存圖像到相冊失敗", + "uni.setClipboardData.success": "內容已復制", "uni.picker.done": "完成", "uni.picker.cancel": "取消", "uni.video.danmu": "彈幕", diff --git a/src/core/helpers/protocol/device/set-clipboard-data.js b/src/core/helpers/protocol/device/set-clipboard-data.js index 8038bfc92a818f987a8dde15c83a735d1dfc9580..7f1da9a9797fda7b6d2514e319b3021518b5c63f 100644 --- a/src/core/helpers/protocol/device/set-clipboard-data.js +++ b/src/core/helpers/protocol/device/set-clipboard-data.js @@ -1,9 +1,19 @@ +import { + t +} from 'uni-core/helpers/i18n' + export const setClipboardData = { beforeSuccess () { - uni.showToast({ - title: '内容已复制', - icon: 'success', - mask: false - }) + const title = t('uni.setClipboardData.success') + if (title) { + uni.showToast({ + title: t('uni.setClipboardData.success'), + icon: 'success', + mask: false, + style: { + width: undefined + } + }) + } } -} +} diff --git a/src/platforms/app-plus/service/api/ui/popup.js b/src/platforms/app-plus/service/api/ui/popup.js index 20d0685f42963a2988d4c302c9ca0cb7401b741d..9e2cd1972b002a45364c7d6d5422efb06f9f6b86 100644 --- a/src/platforms/app-plus/service/api/ui/popup.js +++ b/src/platforms/app-plus/service/api/ui/popup.js @@ -31,7 +31,8 @@ export function showToast ({ duration = 1500, mask = false, position = '', - type = 'toast' + type = 'toast', + style } = {}) { hide(null) toastType = type @@ -79,7 +80,7 @@ export function showToast ({ } } - toast = plus.nativeUI.showWaiting(title, waitingOptions) + toast = plus.nativeUI.showWaiting(title, Object.assign(waitingOptions, style)) } timeout = setTimeout(() => {