chore: replace all cn comments of fe to en version by volc api (#320)

This commit is contained in:
tecvan
2025-07-31 10:32:15 +08:00
committed by GitHub
parent 716ec0cba8
commit 71f6245a01
2960 changed files with 15545 additions and 15545 deletions

View File

@@ -3,13 +3,13 @@
block_unresolved_conflict() {
set -e
[ "$CI" = "true" ] && set -x
# git冲突标记符一般为7个字符
# Git conflict marker, typically 7 characters
local match="<<<<<<<|=======|>>>>>>>"
local diff_params="$1 --name-status -G $match"
local count=0
if [[ $1 == *..* ]]; then
# 检查分支是否存在,可以解决 merge 之后 feature 分支被 removed ,导致 git 报错的问题。
# Checking whether the branch exists can solve the problem that the feature branch is removed after the merge, resulting in an error in git.
sourceBranch=${1%%..*}
targetBranch=${1#*..}
if ! git branch -a | grep -qE "$sourceBranch"; then
@@ -36,7 +36,7 @@ block_unresolved_conflict() {
diff_params+=" $exclude_string"
# 只检测修改的文件
# Only detect modified files
conflicts=$(git diff $diff_params | grep '^M' | cut -f 2-)
if [[ -n "$conflicts" ]]; then

View File

@@ -2,19 +2,19 @@
git fetch
# 要删除的远程分支完整名称列表包含origin前缀
# List of complete names of the remote branch to delete, including the origin prefix
declare -a branches_to_delete_full=(
origin/feat/analysis-tyy
origin/feat/query_classify
)
# 远程仓库的名称,默认为origin
# The name of the remote repository, default is origin
remote_name="origin"
# 函数,用于删除远程分支
# Function to delete a remote branch
delete_branch() {
local branch_name_with_origin=$1
# 去除origin前缀
# Remove the origin prefix
local branch_name=$(echo "$branch_name_with_origin" | sed 's/^'"$remote_name"'\///')
if git show-ref --verify --quiet "refs/remotes/$branch_name_with_origin"; then
@@ -30,7 +30,7 @@ delete_branch() {
fi
}
# 遍历分支列表并调用删除函数
# Traverse the branch list and call the delete function
for full_branch_name in "${branches_to_delete_full[@]}"; do
delete_branch "$full_branch_name"
done

View File

@@ -1,20 +1,20 @@
#!/bin/bash
# 需要搜索的目录
SEARCH_DIR=${1:-.} # 默认目录为当前目录
# Directory to search
SEARCH_DIR=${1:-.} # The default directory is the current directory
# 检查输入参数
# Check input parameters
if [ -z "$SEARCH_DIR" ]; then
echo "Usage: $0 <search_directory>"
exit 1
fi
# 获取所有被 Git 跟踪的 .tsx .less 文件
# Get all .tsx and .less files tracked by Git
git ls-files --others --ignored --exclude-standard -o -c -- "$SEARCH_DIR" ':!*.tsx' ':!*.less' | while read -r FILE; do
if [[ "$FILE" == *.tsx || "$FILE" == *.less ]]; then
# 获取文件行数
# Get the number of file lines
LINE_COUNT=$(wc -l < "$FILE")
# 如果文件行数为空,删除文件并输出文件路径
# If the file line count is empty, delete the file and output the file path
if [ "$LINE_COUNT" -eq 0 ]; then
echo "Deleting empty file: $FILE"
rm "$FILE"

View File

@@ -9,7 +9,7 @@ fi
# pushd $ROOT_DIR/packages/arch/i18n && npm run pull-i18n && popd || exit
node $ROOT_DIR/common/scripts/install-run-rush.js pull-idl -a install || exit
if [ "$NO_STARLING" != true ]; then
# 更新文案
# Update copy
pushd $ROOT_DIR/ee/infra/sync-scripts && npm run sync:starling && popd || exit
pushd $ROOT_DIR/ee/infra/sync-scripts && npm run sync:starling-cozeloop && popd || exit
fi
@@ -19,7 +19,7 @@ if [ "$CI" != "true" ]; then
fi
# if [ -z "$BUILD_TYPE" ]; then
# # 更新 icon
# #update icon
# pushd $ROOT_DIR/ee/infra/sync-scripts && npm run sync:icon && popd || exit
# pushd $ROOT_DIR/ee/infra/sync-scripts && npm run sync:illustration && popd || exit
# fi

View File

@@ -1,8 +1,8 @@
#!/bin/bash
# 设置红色颜色的 ANSI 转义码
# Set the red ANSI escape code
RED='\033[0;31m'
# 重置颜色的 ANSI 转义码
# ANSI escape code to reset color
NC='\033[0m'
CURRENT_USER=$(git config user.email)

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# 该脚本用与在 scm 内执行 包发布逻辑
# The script is used to execute the package publishing logic within the SCM
source ./scripts/scm_base.sh
@@ -110,7 +110,7 @@ if [ "$MODE" == "version" -o "$MODE" == "multiple" ]; then
echo "执行 version"
if [ "$MODE" == "multiple" ]; then
# multiple 模式下只输出 publish 步骤的结果即可
# In multiple mode, only the result of the publish step can be output
node ee/infra/rush-x/bin/run version $PUBLISH_TYPE $PUBLISH_TAG $PATCH_TAG $TO_PACKAGES $FROM_TAG $BY_DIFF $INDEPENDENT -b $DEFAULT_BRANCH
else
node ee/infra/rush-x/bin/run version $PUBLISH_TYPE $PUBLISH_TAG $PATCH_TAG $TO_PACKAGES $FROM_TAG $BY_DIFF $INDEPENDENT $WEBHOOK_URL $BUILD_USER -b $DEFAULT_BRANCH
@@ -133,7 +133,7 @@ if [ "$MODE" == "publish" -o "$MODE" == "multiple" ]; then
echo "publish 完成"
fi
# 更新 distTag
# Update distTag
if [ "$MODE" == "tag" ]; then
fetch
mkdir -p $ROOT_DIR/output
@@ -141,7 +141,7 @@ if [ "$MODE" == "tag" ]; then
echo "Publish sha $PUBLISH_SHA" >>$ROOT_DIR/output/output.txt
echo "执行 dist tag"
# 不同模式下点 WEBHOOK_URL 基本不同,需要再传参时注意
# The point WEBHOOK_URL are basically different in different modes, and you need to pay attention when passing parameters again
node ee/infra/rush-x/bin/run publish --sha $PUBLISH_SHA $PUBLISH_TAG --dist-tag $WEBHOOK_URL $BUILD_USER
echo "dist-tag 完成"
fi

View File

@@ -1,6 +1,6 @@
retry() {
local retries=$1 # 重试次数
local wait_time=$2 # 等待时间
local retries=$1 # number of retries
local wait_time=$2 # waiting time
shift 2
local count=0

View File

@@ -1,14 +1,14 @@
#!/usr/bin/env bash
# Setup common env for CI & SCM
# 1. 忽略不影响构建的 install
# 1. Ignore installs that do not affect builds
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true
export CYPRESS_INSTALL_BINARY=0
export TAIKO_SKIP_CHROMIUM_DOWNLOAD=0
export RE2_DOWNLOAD_SKIP_PATH=1
export RE2_DOWNLOAD_MIRROR="https://bnpm.bytedance.net/mirrors"
# 2. 在 CI 环境生效:
# 2. Effective in the CI environment:
echo ::set-env name=PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD::$PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD
echo ::set-env name=CYPRESS_INSTALL_BINARY::$CYPRESS_INSTALL_BINARY
echo ::set-env name=TAIKO_SKIP_CHROMIUM_DOWNLOAD::$TAIKO_SKIP_CHROMIUM_DOWNLOAD

View File

@@ -13,15 +13,15 @@ fi
directory=$1
#首先创建或清空已有的结果文件
#First create or empty an existing result file
echo "Directory, files,language,blank,comment,code" > cloc_results2.csv
#使用find命令来查找foo目录下的所有子目录
#如果你只想遍历直接子目录,可以去掉-maxdepth-mindepth选项
#Use the find command to find all subdirectories in the foo directory
#If you only want to iterate through direct subdirectories, you can remove the -maxdepth and -mindepth options
find $directory -type d -mindepth 1 -maxdepth 1 | while read subdir
do
#使用cloc工具计算每个子目录的代码行数
#然后使用awk工具来提取需要的数据目录名、文件数、代码行数
#Use the cloc tool to calculate the number of lines of code per subdirectory
#Then use the awk tool to extract the required data: directory name, number of files, and number of lines of code
cloc_result=$(cloc $subdir --csv --quiet | tail -n 1)
lines=$(echo "$cloc_result" | awk -F "\"*,\"*" 'NR==3 {print $4}')
echo "$subdir, $cloc_result" >> cloc_results2.csv