AI automatically translates all comments in the code into English (#3917)

This commit is contained in:
alex
2024-09-19 14:53:50 +08:00
committed by GitHub
parent 046de691cb
commit 4152dcd409
279 changed files with 10602 additions and 3038 deletions

View File

@@ -107,7 +107,8 @@ void process_file(const char *file) {
File::saveFile(str, file);
}
/// 这个程序是为了统一替换tab为4个空格
// / 这个程序是为了统一替换tab为4个空格 [AUTO-TRANSLATED:ecb3b523]
// / This program is for unified replacement of tabs with 4 spaces
int main(int argc, char *argv[]) {
CMD_main cmd_main;
try {
@@ -127,26 +128,31 @@ int main(int argc, char *argv[]) {
}
bool no_filter = filter_set.find("*") != filter_set.end();
//设置日志
// 设置日志 [AUTO-TRANSLATED:50372045]
// Set log
Logger::Instance().add(std::make_shared<ConsoleChannel>());
File::scanDir(path, [&](const string &path, bool isDir) {
if (isDir) {
return true;
}
if (!no_filter) {
//开启了过滤器
// 开启了过滤器 [AUTO-TRANSLATED:331a77dd]
// Filter enabled
auto pos = strstr(path.data(), ".");
if (pos == nullptr) {
//没有后缀
// 没有后缀 [AUTO-TRANSLATED:2273522f]
// No suffix
return true;
}
auto ext = pos + 1;
if (filter_set.find(ext) == filter_set.end()) {
//后缀不匹配
// 后缀不匹配 [AUTO-TRANSLATED:7e30f0b4]
// Suffix does not match
return true;
}
}
//该文件匹配
// 该文件匹配 [AUTO-TRANSLATED:9dce5098]
// File matches
process_file(path.data());
return true;
}, true);