Skip to content

Commit

Permalink
missing English doc is ok.
Browse files Browse the repository at this point in the history
Signed-off-by: doujiang24 <doujiang24@gmail.com>
  • Loading branch information
doujiang24 committed Jul 23, 2024
1 parent 08b4f64 commit ebe46e6
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions tools/cmd/linter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,25 @@ func lintSite() error {
}
}
for doc := range zhHansDocs {
if _, ok := enDocs[doc]; !ok {
fmt.Printf("file %s is missing in English documentation\n", doc)
}

zhMs, err := readDoc(filepath.Join("site", "content", "zh-hans", doc), LangZhHans)
if err != nil {
return err
}

enMs, err := readDoc(filepath.Join("site", "content", "en", doc), LangEn)
if err != nil {
return err
}
if _, ok := enDocs[doc]; !ok {
fmt.Printf("file %s is missing in English documentation\n", doc)
} else {
enMs, err := readDoc(filepath.Join("site", "content", "en", doc), LangEn)
if err != nil {
return err
}

if !reflect.DeepEqual(enMs, zhMs) {
zhMsOut, _ := json.MarshalIndent(zhMs, "", " ")
enMsOut, _ := json.MarshalIndent(enMs, "", " ")
fmt.Printf("mismatched fields in %s:\nSimpilified Chinese %s\nEnglish %s\n", doc, zhMsOut, enMsOut)
if !reflect.DeepEqual(enMs, zhMs) {
zhMsOut, _ := json.MarshalIndent(zhMs, "", " ")
enMsOut, _ := json.MarshalIndent(enMs, "", " ")
fmt.Printf("mismatched fields in %s:\nSimpilified Chinese %s\nEnglish %s\n", doc, zhMsOut, enMsOut)
}
}

}

return nil
Expand Down

0 comments on commit ebe46e6

Please sign in to comment.