参考网上的代码,借助 AI 搞出来的。
1 下载Python脚本 SogouTranslatorGD.py:
2 添加词典:
python "D:\GoldenDict\content\SogouTranslatorGD.py" "https://fanyi.sogou.com/text?keyword=%GDWORD%&transfrom=auto&transto=zh-CHS&model=general"
3 修改 article-style.css 添加以下样式,隐藏一些不必要的元素。
现在可以忽略这一步。直接配置词典即可,不用单独修改样式文件。
/* Sogou Translate */
.programs_html .tab-trans-main .dict .module + .module {
border-top-color: rgb(40 40 40);
}
.programs_html .tab-trans-main .dict .module h3 {
color: rgb(229 149 33) !important;
font-size: 18px !important;
font-weight: bold !important;
}
.programs_html .select-area,
.programs_html .operate-box,
.programs_html #encyclopedia,
.programs_html .sort-select,
.programs_html .sgui-content,
.programs_html .footer-wap,
.programs_html .loading-pc {
display: none !important;
}
.programs_html .trans-box {
cursor: not-allowed;
pointer-events: none;
}
.programs_html .word-details-card .word-details-con .word {
color:rgb(235, 98, 45) !important;
}
.programs_html .trans-box {
color:rgb(134, 170, 204); !important;
}
.programs_html textarea#trans-input {
width: 100% !important;
padding: 5px !important;
}
/* Sogou Translate */