Skip to content

Commit dd54ac2

Browse files
feat: add comment language check for Chinese characters in pre-commit hook
- Replace all Chinese comments with English equivalents - Improve code readability for international contributors - Translate by qwen3-8b using tools uploaded on https://github.com/Artlesbol/llm-comments-translator# - Add language check in pre-commit hook --------- Co-authored-by: CharlesXin <110083740+charlesxzb@users.noreply.github.com>
1 parent ff3e3b2 commit dd54ac2

82 files changed

Lines changed: 8392 additions & 8160 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [ -n "$2" ]; then
5151
fi
5252
fi
5353

54-
# 检查覆盖率环境变量
54+
# Check coverage environment variables
5555
if [ "${ENABLE_COVERAGE}" = "True" ]; then
5656
ENABLE_COVERAGE_FLAG="ON"
5757
echo "Building with code coverage enabled"

docs/developer_manual/source_en/conf.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,36 +115,36 @@
115115
htmlhelp_basename = "TPU-MLIR Technical Reference Manual"
116116

117117

118-
# 图片和表格自动编号
118+
# Images and tables auto numbering
119119
numfig = True
120120

121121
# -- Options for LaTeX output ------------------------------------------------
122122
latex_engine = 'xelatex'
123123
latex_elements = {
124124
# Papersize ('letterpaper' or 'a4paper'), default is letterpaper
125125
'papersize': 'a4paper',
126-
# 设置页边距大小
126+
# Set page margin size
127127
'geometry': r' \usepackage[left=2.8cm,right=2.6cm,top=3.7cm,bottom=3.5cm]{geometry}',
128128
# The font size ('10pt', '11pt' or '12pt'), default is '10pt'.
129129
'pointsize': '11pt',
130130
# \setCJKmainfont[BoldFont=Heiti SC Medium]{Heiti SC Light}
131131
# \setCJKmonofont[BoldFont=Times Regular]{Times Italic}
132132
# `\setmainfont`、`\setsansfont{}`、`\setmonofont{}`
133-
# 分别设置正文字体、无衬线字体: 标题、等宽字体: 用于抄录内容
133+
# Set body font and sans-serif font: title, monospace font: for copying content.
134134
'fontpkg': r'''
135135
\setmainfont{FandolSong}
136136
\setsansfont{FandolHei}
137137
\setmonofont{FandolFang}
138138
''',
139-
# 设置章节标题样式
139+
# Set section heading style
140140
# \usepackage[Lenny]{fncychap} Bjarne, Sonny, Lenny, Glenn, Conny, Rejne
141141
'fncychap': '\\usepackage[Sonny]{fncychap}',
142-
# 图片严格出现在文字处
142+
# Image strictly appears in the text area
143143
# 'figure_align': 'H',
144-
# preamble 样式
145-
# 目录样式: tocloft
146-
# 每节从新页面开始: newcommand{\sectionbreak}{\clearpage}
147-
# 全文文本左对齐: \usepackage[document]{ragged2e}
144+
# preamble style
145+
# Table of Contents Style: tocloft
146+
# Each section starts on a new page: \newcommand{\sectionbreak}{\clearpage}
147+
# Left-aligned text throughout: \usepackage[document]{ragged2e}
148148
'preamble':r'''
149149
\usepackage{tocloft}
150150
\renewcommand\cftfignumwidth{4em}

docs/developer_manual/source_zh/conf.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,36 +116,36 @@
116116
htmlhelp_basename = "TPU-MLIR开发参考手册"
117117

118118

119-
# 图片和表格自动编号
119+
# Auto-numbering of images and tables
120120
numfig = True
121121

122122
# -- Options for LaTeX output ------------------------------------------------
123123
latex_engine = 'xelatex'
124124
latex_elements = {
125125
# Papersize ('letterpaper' or 'a4paper'), default is letterpaper
126126
'papersize': 'a4paper',
127-
# 设置页边距大小
127+
# Set page margin size
128128
'geometry': r' \usepackage[left=2.8cm,right=2.6cm,top=3.7cm,bottom=3.5cm]{geometry}',
129129
# The font size ('10pt', '11pt' or '12pt'), default is '10pt'.
130130
'pointsize': '11pt',
131131
# \setCJKmainfont[BoldFont=Heiti SC Medium]{Heiti SC Light}
132132
# \setCJKmonofont[BoldFont=Times Regular]{Times Italic}
133133
# `\setmainfont`、`\setsansfont{}`、`\setmonofont{}`
134-
# 分别设置正文字体、无衬线字体: 标题、等宽字体: 用于抄录内容
134+
# Set body font, sans-serif font: title, monospace font: for transcribing content
135135
'fontpkg': r'''
136136
\setmainfont{FandolSong}
137137
\setsansfont{FandolHei}
138138
\setmonofont{FandolFang}
139139
''',
140-
# 设置章节标题样式
140+
# Set section title style
141141
# \usepackage[Lenny]{fncychap} Bjarne, Sonny, Lenny, Glenn, Conny, Rejne
142142
'fncychap': '\\usepackage[Sonny]{fncychap}',
143-
# 图片严格出现在文字处
143+
# The image must strictly appear in the text area.
144144
# 'figure_align': 'H',
145-
# preamble 样式
146-
# 目录样式: tocloft
147-
# 每节从新页面开始: newcommand{\sectionbreak}{\clearpage}
148-
# 全文文本左对齐: \usepackage[document]{ragged2e}
145+
# preamble style
146+
# Table of contents style: tocloft
147+
# Each section starts on a new page: \newcommand{\sectionbreak}{\clearpage}
148+
# Left-align all text: \usepackage[document]{ragged2e}
149149
'preamble':r'''
150150
\usepackage{tocloft}
151151
\renewcommand\cftfignumwidth{4em}

docs/quick_start/source_en/conf.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,36 +115,36 @@
115115
htmlhelp_basename = "TPU-MLIR Quick Start"
116116

117117

118-
# 图片和表格自动编号
118+
# Auto-numbering for images and tables
119119
numfig = True
120120

121121
# -- Options for LaTeX output ------------------------------------------------
122122
latex_engine = 'xelatex'
123123
latex_elements = {
124124
# Papersize ('letterpaper' or 'a4paper'), default is letterpaper
125125
'papersize': 'a4paper',
126-
# 设置页边距大小
126+
# Set page margin size
127127
'geometry': r' \usepackage[left=2.8cm,right=2.6cm,top=3.7cm,bottom=3.5cm]{geometry}',
128128
# The font size ('10pt', '11pt' or '12pt'), default is '10pt'.
129129
'pointsize': '11pt',
130130
# \setCJKmainfont[BoldFont=Heiti SC Medium]{Heiti SC Light}
131131
# \setCJKmonofont[BoldFont=Times Regular]{Times Italic}
132132
# `\setmainfont`、`\setsansfont{}`、`\setmonofont{}`
133-
# 分别设置正文字体、无衬线字体: 标题、等宽字体: 用于抄录内容
133+
# Set main text font, sans-serif font: title, monospace font for copied content
134134
'fontpkg': r'''
135135
\setmainfont{FandolSong}
136136
\setsansfont{FandolHei}
137137
\setmonofont{FandolFang}
138138
''',
139-
# 设置章节标题样式
139+
# Set section title style
140140
# \usepackage[Lenny]{fncychap} Bjarne, Sonny, Lenny, Glenn, Conny, Rejne
141141
'fncychap': '\\usepackage[Sonny]{fncychap}',
142-
# 图片严格出现在文字处
142+
# Image must be placed at the text's position.
143143
# 'figure_align': 'H',
144-
# preamble 样式
145-
# 目录样式: tocloft
146-
# 每节从新页面开始: newcommand{\sectionbreak}{\clearpage}
147-
# 全文文本左对齐: \usepackage[document]{ragged2e}
144+
# preamble style
145+
# Table of contents style: tocloft
146+
# Each section starts on a new page: \newcommand{\sectionbreak}{\clearpage}
147+
# Left-align all text: \usepackage[document]{ragged2e}
148148
'preamble':r'''
149149
\usepackage{tocloft}
150150
\renewcommand\cftfignumwidth{4em}

docs/quick_start/source_zh/conf.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,36 +115,36 @@
115115
htmlhelp_basename = "TPU-MLIR快速入门指南"
116116

117117

118-
# 图片和表格自动编号
118+
# Image and Table Auto Numbering
119119
numfig = True
120120

121121
# -- Options for LaTeX output ------------------------------------------------
122122
latex_engine = 'xelatex'
123123
latex_elements = {
124124
# Papersize ('letterpaper' or 'a4paper'), default is letterpaper
125125
'papersize': 'a4paper',
126-
# 设置页边距大小
126+
# Set page margin size
127127
'geometry': r' \usepackage[left=2.8cm,right=2.6cm,top=3.7cm,bottom=3.5cm]{geometry}',
128128
# The font size ('10pt', '11pt' or '12pt'), default is '10pt'.
129129
'pointsize': '11pt',
130130
# \setCJKmainfont[BoldFont=Heiti SC Medium]{Heiti SC Light}
131131
# \setCJKmonofont[BoldFont=Times Regular]{Times Italic}
132132
# `\setmainfont`、`\setsansfont{}`、`\setmonofont{}`
133-
# 分别设置正文字体、无衬线字体: 标题、等宽字体: 用于抄录内容
133+
# Set body font and sans-serif font: title, monospace font: for transcribing content
134134
'fontpkg': r'''
135135
\setmainfont{FandolSong}
136136
\setsansfont{FandolHei}
137137
\setmonofont{FandolFang}
138138
''',
139-
# 设置章节标题样式
139+
# Set section title style
140140
# \usepackage[Lenny]{fncychap} Bjarne, Sonny, Lenny, Glenn, Conny, Rejne
141141
'fncychap': '\\usepackage[Sonny]{fncychap}',
142-
# 图片严格出现在文字处
142+
# The image must strictly appear at the text's position.
143143
# 'figure_align': 'H',
144-
# preamble 样式
145-
# 目录样式: tocloft
146-
# 每节从新页面开始: newcommand{\sectionbreak}{\clearpage}
147-
# 全文文本左对齐: \usepackage[document]{ragged2e}
144+
# Preamble style
145+
# Table of Contents Style: tocloft
146+
# Each section starts on a new page: \newcommand{\sectionbreak}{\clearpage}
147+
# Left-align all text: \usepackage[document]{ragged2e}
148148
'preamble':r'''
149149
\usepackage{tocloft}
150150
\renewcommand\cftfignumwidth{4em}

envsetup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export FORBID_GEN_RISCV_CODE=1
6060
# CCache configuration
6161
export CCACHE_REMOTE_STORAGE=redis://10.132.3.118:6379
6262

63-
# 覆盖率相关设置
63+
# Coverage related settings
6464
export ENABLE_COVERAGE=False
6565
function enable_coverage() {
6666
export ENABLE_COVERAGE=True

0 commit comments

Comments
 (0)