🎨 桌面端和浏览器端支持英文拼写检查 https://github.com/siyuan-note/siyuan/issues/597

This commit is contained in:
Liang Ding 2022-12-30 11:27:26 +08:00
parent 40bbc6cc98
commit fc66472637
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
13 changed files with 29 additions and 3 deletions

View file

@ -806,6 +806,8 @@
"outdent": "Outdent",
"outlineOutdent": "List outline outdent",
"outlineOutdentTip": "After enabling, the outdent will be using the list outline logic, i.e. moving the list items below the parent",
"spellcheck": "Spell Check",
"spellcheckTip": "After enabling, the browser's built-in spell check function will be used. Currently, only English spell check is supported",
"over": "over",
"preview": "Export Preview",
"quote": "Blockquote",

View file

@ -806,6 +806,8 @@
"outdent": "anular la sangría",
"outlineOutdent": "Lista de contorno sin sangría",
"outlineOutdentTip": "Después de habilitar, el outdent utilizará la lógica de esquema de la lista, es decir, moviendo los elementos de la lista debajo del padre",
"spellcheck": "Corrección ortográfica",
"spellcheckTip": "Después de habilitar, se utilizará la función de revisión ortográfica integrada del navegador. Actualmente, solo se admite la revisión ortográfica en inglés",
"over": "sobre",
"preview": "Vista previa de la exportación",
"quote": "Párrafo cita",

View file

@ -806,6 +806,8 @@
"outdent": "Outdent",
"outlineOutdent": "Liste des retraits excessifs du contour",
"outlineOutdentTip": "Après l'activation, le retrait négatif utilisera la logique de contour de la liste, c'est-à-dire en déplaçant les éléments de la liste sous le parent",
"spellcheck": "Vérification orthographique",
"spellcheckTip": "Après l'activation, la fonction de vérification orthographique intégrée du navigateur sera utilisée. Actuellement, seule la vérification orthographique en anglais est prise en charge",
"over": "over",
"preview": "Aperçu de l'exportation",
"quote": "Citation de bloc",

View file

@ -806,6 +806,8 @@
"outdent": "列表反向縮進",
"outlineOutdent": "列表大綱反向縮進",
"outlineOutdentTip": "啟用後將使用列表大綱式邏輯反向縮進,即將列表項移動到父級下方",
"spellcheck": "拼寫檢查",
"spellcheckTip": "啟用後將使用瀏覽器內置的拼寫檢查功能,目前僅支持英文拼寫檢查",
"over": "超過",
"preview": "匯出預覽",
"quote": "引述",

View file

@ -806,6 +806,8 @@
"outdent": "列表反向缩进",
"outlineOutdent": "列表大纲反向缩进",
"outlineOutdentTip": "启用后将使用列表大纲式逻辑反向缩进,即将列表项移动到父级下方",
"spellcheck": "拼写检查",
"spellcheckTip": "启用后将使用浏览器内置的拼写检查功能,目前仅支持英文拼写检查",
"over": "超过",
"preview": "导出预览",
"quote": "引述",

View file

@ -199,6 +199,8 @@ const boot = () => {
mainWindow.webContents.userAgent = 'SiYuan/' + appVer +
' https://b3log.org/siyuan Electron'
mainWindow.webContents.session.setSpellCheckerLanguages(['en-US'])
// 发起互联网服务请求时绕过安全策略 https://github.com/siyuan-note/siyuan/issues/5516
mainWindow.webContents.session.webRequest.onBeforeSendHeaders(
(details, cb) => {

View file

@ -133,6 +133,14 @@ export const editor = {
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="listLogicalOutdent" type="checkbox"${window.siyuan.config.editor.listLogicalOutdent ? " checked" : ""}/>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.spellcheck}
<div class="b3-label__text">${window.siyuan.languages.spellcheckTip}</div>
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="spellcheck" type="checkbox"${window.siyuan.config.editor.spellcheck ? " checked" : ""}/>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.md31}
@ -298,6 +306,7 @@ export const editor = {
codeSyntaxHighlightLineNum: (editor.element.querySelector("#codeSyntaxHighlightLineNum") as HTMLInputElement).checked,
embedBlockBreadcrumb: (editor.element.querySelector("#embedBlockBreadcrumb") as HTMLInputElement).checked,
listLogicalOutdent: (editor.element.querySelector("#listLogicalOutdent") as HTMLInputElement).checked,
spellcheck: (editor.element.querySelector("#spellcheck") as HTMLInputElement).checked,
floatWindowMode: (editor.element.querySelector("#floatWindowMode") as HTMLInputElement).checked ? 0 : 1,
plantUMLServePath: (editor.element.querySelector("#plantUMLServePath") as HTMLInputElement).value,
katexMacros: (editor.element.querySelector("#katexMacros") as HTMLTextAreaElement).value,

View file

@ -283,6 +283,7 @@ declare interface IEditor {
rtl: boolean;
readOnly: boolean;
listLogicalOutdent: boolean;
spellcheck: boolean;
katexMacros: string;
fullWidth: boolean;
floatWindowMode: number;

File diff suppressed because one or more lines are too long

View file

@ -42,6 +42,7 @@ type Editor struct {
DynamicLoadBlocks int `json:"dynamicLoadBlocks"` // 块动态数,可配置区间 [48, 1024]
Justify bool `json:"justify"` // 是否两端对齐
RTL bool `json:"rtl"` // 是否从右到左显示
Spellcheck bool `json:"spellcheck"` // 是否启用拼写检查
}
func NewEditor() *Editor {

View file

@ -6,7 +6,7 @@ require (
github.com/88250/clipboard v0.1.5
github.com/88250/css v0.1.2
github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798
github.com/88250/lute v1.7.5-0.20221228091547-322f538d4f33
github.com/88250/lute v1.7.5-0.20221230030827-df878c76f85d
github.com/88250/pdfcpu v0.3.13
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732

View file

@ -19,6 +19,8 @@ github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798 h1:sR/s/Y9wyl79ZRCUER
github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
github.com/88250/lute v1.7.5-0.20221228091547-322f538d4f33 h1:2A3pQE3Av78X690Q0deDMpT31ytc7PGIt4TNDBRlD9A=
github.com/88250/lute v1.7.5-0.20221228091547-322f538d4f33/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20221230030827-df878c76f85d h1:EVKgCxsEpdCihMruXobiaU5tNPY6dxJL2/F8MJ/jGq0=
github.com/88250/lute v1.7.5-0.20221230030827-df878c76f85d/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=
github.com/88250/pdfcpu v0.3.13/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View file

@ -451,6 +451,7 @@ func NewLute() (ret *lute.Lute) {
ret.SetCodeSyntaxHighlightLineNum(Conf.Editor.CodeSyntaxHighlightLineNum)
ret.SetChineseParagraphBeginningSpace(Conf.Export.ParagraphBeginningSpace)
ret.SetProtyleMarkNetImg(Conf.Editor.DisplayNetImgMark)
ret.SetSpellcheck(Conf.Editor.Spellcheck)
customEmojiMap := map[string]string{}
CustomEmojis.Range(func(key, value interface{}) bool {