From: Caisking Date: Mon, 16 Jun 2025 09:44:37 +0000 (+0800) Subject: 修改多国语言脚本,适配多项目使用 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=cfc0c6f116eceea3d36de1f68ba4b9a54f88f6a8;p=mirrors%2FFD230.git 修改多国语言脚本,适配多项目使用 --- diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/en.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/en.lang index 2bfb73634..1bf0019ac 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/en.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/en.lang differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/ui_resource_string.h b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/ui_resource_string.h index 7127be443..6b6ba1fe7 100644 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/ui_resource_string.h +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/ui_resource_string.h @@ -652,7 +652,9 @@ enum UIResourceTextId : uint16_t { STR_RECORD_MAX = 639, STR_CLEAR_ALL_RECORDS = 640, STR_DEEPSEEK = 641, - STR_MAX_ID = 642, + STR_BP_CHECK = 642, + STR_BP_CALIBRATE = 643, + STR_MAX_ID = 644, }; // UIResourceTextId enum FontLanguageId : uint8_t { diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/zh.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/zh.lang index 056633ba1..7d4412586 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/zh.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/font/zh.lang differ diff --git a/tools/language_tool/make_language.sh b/tools/language_tool/make_language.sh index 21066595a..222cd3e47 100755 --- a/tools/language_tool/make_language.sh +++ b/tools/language_tool/make_language.sh @@ -1,22 +1,57 @@ -#!/bin/bash +#!/bin/bash ### # @Date: 2024-07-11 20:53:59 - # @LastEditors: SnickerSun snickersun@163.com + # @LastEditors: Caisking snickersun@163.com # @LastEditTime: 2024-08-30 18:39:57 # @FilePath: /FD230/tools/language_tool/make_language.sh ### -set -e # 在命令失败时退出 +set -e # 在命令失败时退出 + +# 帮助函数 +function show_help() { + echo "用法: $0 [选项] [项目名]" + echo "选项:" + echo " -h, --help 显示此帮助信息" + echo "项目名:" + echo " fd230 处理FD230项目" + echo " w9 处理W9项目" + echo " n9 处理N9项目" + echo " all 处理所有项目" + exit 1 +} + +# 解析命令行参数 +PROJECT="" +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + show_help + ;; + fd230|w9|n9|all) + PROJECT="$1" + shift + ;; + *) + echo "错误: 未知参数 '$1'" + show_help + ;; + esac +done + +# 检查是否提供了项目参数 +if [[ -z "$PROJECT" ]]; then + echo "错误: 必须指定项目参数" + show_help +fi # 进入目录 Language_xml cd Language_xml/ -#cd表格生成路径 -cd ../Language_xml/ -#运行 生成xlsx表格 +# 运行 生成xlsx表格 python extract_xlsx_2_txt.py -# 运行 convert_txt_2_xlsx.py +# 运行 convert_txt_2_xml.py python convert_txt_2_xml.py # 回到上级目录 @@ -31,13 +66,47 @@ python language_trans.py ../Language_xml/ ../font/ ../font/ # 打印完成信息 echo "脚本生成文件执行完成。" -#复制头文件 -cp ../font/ui_resource_string.h ../../../code/sdk/application/wearable/fd230app/nativelauncher/include/ - -#复制资源文件 -cp -r ../font ../../../code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/ +# 根据项目参数选择目标路径 +function process_project() { + local project_name="$1" + local target_path="" + local include_path="" + + case "$project_name" in + fd230) + target_path="../../../code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/" + include_path="../../../code/sdk/application/wearable/fd230app/nativelauncher/include/" + ;; + w9) + target_path="../../../code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/" + include_path="../../../code/sdk/application/wearable/fd230app/nativelauncher/include/" + ;; + n9) + target_path="../../../code/sdk/build/config/target_config/brandy/mk_fs_image/n9/fs/user/res/" + include_path="../../../code/sdk/application/wearable/fd230app/nativelauncher/include/" + ;; + *) + echo "错误: 未知项目 '$project_name'" + return 1 + ;; + esac + + # 复制头文件 + cp ../font/ui_resource_string.h "$include_path" + + # 复制资源文件 + cp -r ../font "$target_path" + + echo "项目 '$project_name' 复制文件执行完成。" +} -#打印完成信息 -echo "脚本复制文件执行完成。" - +# 根据项目参数执行相应操作 +if [[ "$PROJECT" == "all" ]]; then + for p in fd230 w9 n9; do + process_project "$p" + done +else + process_project "$PROJECT" +fi +echo "所有操作执行完成。" \ No newline at end of file