dsh-plugin-look-up 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +3 -3
- package/index.js +1 -1
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -30,7 +30,7 @@ window.__ModuleLoader__.load({
|
|
|
30
30
|
helperMissing: 'The dictionary helper is missing. Reinstall the plugin.',
|
|
31
31
|
timeout: 'The dictionary took too long. Try again.',
|
|
32
32
|
failed: 'Lookup failed. Try again.',
|
|
33
|
-
|
|
33
|
+
copyWord: 'Copy word',
|
|
34
34
|
copied: 'Copied',
|
|
35
35
|
openInDictionary: 'Open in Dictionary',
|
|
36
36
|
source: 'macOS system dictionaries · offline',
|
|
@@ -45,7 +45,7 @@ window.__ModuleLoader__.load({
|
|
|
45
45
|
helperMissing: '词典组件缺失,请重新安装插件。',
|
|
46
46
|
timeout: '查询超时,请重试。',
|
|
47
47
|
failed: '查询失败,请重试。',
|
|
48
|
-
|
|
48
|
+
copyWord: '复制单词',
|
|
49
49
|
copied: '已复制',
|
|
50
50
|
openInDictionary: '在词典中打开',
|
|
51
51
|
source: 'macOS 系统词典 · 本地查询',
|
|
@@ -626,7 +626,7 @@ window.__ModuleLoader__.load({
|
|
|
626
626
|
'data-copied': copied ? 'true' : undefined,
|
|
627
627
|
onMouseDown: (event) => event.stopPropagation(),
|
|
628
628
|
onClick: () => copyWord(result.word ?? card.word)
|
|
629
|
-
}, copied ? t('copied') : t('
|
|
629
|
+
}, copied ? t('copied') : t('copyWord'))
|
|
630
630
|
: null,
|
|
631
631
|
card.status === 'ready' && navigator.platform !== undefined && /Mac/u.test(navigator.platform)
|
|
632
632
|
? h('button', {
|
package/index.js
CHANGED
|
@@ -171,7 +171,7 @@ async function lookupWord(word) {
|
|
|
171
171
|
async function openInDictionary(word) {
|
|
172
172
|
if (process.platform !== 'darwin') return { ok: false, code: 'unsupported' }
|
|
173
173
|
try {
|
|
174
|
-
await execFileAsync('/usr/bin/open', [
|
|
174
|
+
await execFileAsync('/usr/bin/open', [`dict://${encodeURIComponent(word)}`], {
|
|
175
175
|
timeout: HELPER_TIMEOUT_MS,
|
|
176
176
|
encoding: 'utf8'
|
|
177
177
|
})
|
package/package.json
CHANGED