Skip to content

Commit

Permalink
refactor: applied the new converter dict
Browse files Browse the repository at this point in the history
close #17 #39
  • Loading branch information
t7yang committed Aug 21, 2022
1 parent a2233e3 commit 2661786
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,4 @@ $RECYCLE.BIN/
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

web-ext-artifacts
dict
8 changes: 4 additions & 4 deletions src/background/converter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { PrefWord } from '../../preference/types/v2';

const createSrcPack = async ({ default: def, custom }: PrefWord): Promise<SrcPack> => ({
s2t: [
def.s2t.char ? await fetch(`dictionaries/s2t-char.json`).then(res => res.json()) : {},
def.s2t.phrase ? await fetch(`dictionaries/s2t-phrase.json`).then(res => res.json()) : {},
def.s2t.char ? await fetch(`dictionaries/s2t-char.min.json`).then(res => res.json()) : {},
def.s2t.phrase ? await fetch(`dictionaries/s2t-phrase.min.json`).then(res => res.json()) : {},
custom.s2t,
],
t2s: [
def.t2s.char ? await fetch(`dictionaries/t2s-char.json`).then(res => res.json()) : {},
def.t2s.phrase ? await fetch(`dictionaries/t2s-phrase.json`).then(res => res.json()) : {},
def.t2s.char ? await fetch(`dictionaries/t2s-char.min.json`).then(res => res.json()) : {},
def.t2s.phrase ? await fetch(`dictionaries/t2s-phrase.min.json`).then(res => res.json()) : {},
custom.t2s,
],
});
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = function (env, argv) {
{ from: './node_modules/spectre.css/dist/spectre-exp.min.css' },
{ from: './src/icons', to: 'icons' },
{
from: './node_modules/tongwen-core/dictionaries/**/*',
from: './dict/**/*',
to: 'dictionaries/[name][ext]',
},
],
Expand Down

2 comments on commit 2661786

@huybn5776
Copy link

@huybn5776 huybn5776 commented on 2661786 Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./dict 是不該 commit 上 git 的嗎? 想說沒了它變得不能編譯
目前我 local 這邊把這行復原 或把 s2t-char.json 等等的4個 json 複製過來會可以編譯
要可以執行的話得再把 dictionaries/s2t-char.min.json 改回來,或把 json 改名

@t7yang
Copy link
Contributor Author

@t7yang t7yang commented on 2661786 Sep 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因為現在套用新的辭庫 https://github.com/tongwentang/tongwen-dict
新的辭庫目前還沒有正式的發布管道
所以我目前使用手動的方式複製過來
暫時先這樣吧,我還沒時間去處理辭庫的發布問題

Please sign in to comment.