go-admin
go-admin copied to clipboard
[BUG] Translation
Bug Description [describe the bug in detail]
some parts of the code are in chinese, this is intimidating to international audiences. can these be translated to English?
./plugins/plugins.go line: 410 // TODO: 验证插件合法性
./plugins/example/controller.go line: 97 SetFooter(`<div class="clearfix"><a href="javascript:void(0)" class="btn btn-sm btn-info btn-flat pull-left">处理订单</a><a href="javascript:void(0)" class="btn btn-sm btn-default btn-flat pull-right">查看所有新订单</a> </div>`).
./plugins/admin/controller/plugins.go line: 486 // TODO: 实现运行环境与编译环境隔离
./plugins/admin/controller/common.go line: 122 // TODO: 避免重复增加,第一次加入后,后面大部分会存在重复情况,以下循环可以优化
./plugins/admin/controller/plugins_tmpl.go line: 203 text: "<a target='_blank' href='//baidu.com'>点这里手动下载</a>",
./plugins/admin/controller/install.go line: 38 response.Error(ctx, "请检查参数是否设置正确")
./plugins/admin/controller/install.go line: 48 response.Error(ctx, "请检查参数是否设置正确")
b@m1 go-admin %
How to reproduce [describe the steps how to reproduce the bug]
just read the code
Expect [describe your expect result]
no Chinese in the code. I have nothing against Chinese, but the international audience may be baffled by the errors in Chinese.
Reproduction code [here to show your codes or examples]
# this program checks a folder recursively for files and finds any text
# files that contain chinese characters according to the unicode standard
if __name__ == "__main__":
folder_name = "."
import os
import re
import sys
import unicodedata
import argparse
parser = argparse.ArgumentParser(description="Finds chinese characters in a folder")
parser.add_argument("-f", "--folder", help="The folder to search", default=folder_name)
args = parser.parse_args()
folder_name = args.folder
if not os.path.exists(folder_name):
print("Folder does not exist")
sys.exit(1)
if not os.path.isdir(folder_name):
print("Folder is not a directory")
sys.exit(1)
for root, dirs, files in os.walk(folder_name):
for file in files:
file_path = os.path.join(root, file)
# if the file contains _CN ignore it
if "_CN" in file_path:
continue
try:
with open(file_path, "r", encoding="utf-8") as f:
# check the file line by line
linenum = 0
for line in f:
# check for chinese characters
if re.search(u"[\u4e00-\u9fff]+", line):
# print the file name and the line number and the line
print(file_path, " line: ", linenum," ", line)
# print the unicode characters
linenum += 1
except UnicodeDecodeError:
print("File:"+file+" is not in utf-8 encoding")
sys.exit(1)
sys.exit(0)
Versions
- GoAdmin version: whatever is on the master branch at the moment 1.2.23?
- golang version 1.18?
- Browser irrelevant
- OS irrelevant