From: Caisking <3449750381@qq.com> Date: Mon, 18 Nov 2024 08:55:39 +0000 (+0800) Subject: 多国语言修改 X-Git-Tag: fd230_release_V1.3.102~65 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=3600c4f5ecd7edbd5744dfa961ee7a3c68b5bd42;p=mirrors%2FFD230.git 多国语言修改 --- diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h index 8dfb7f5d6..8c60a072a 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h @@ -611,7 +611,46 @@ enum UIResourceTextId : uint16_t { STR_DIAL_FAIL_LABEL = 598, STR_MP3_FAIL_TITL = 599, STR_MP3_FAIL_LABEL = 600, - STR_MAX_ID = 601, + STR_CALLSOMEONE = 601, + STR_BLUENOTE = 602, + STR_VOICE_FAIL = 603, + STR_WAKE_VOIVE = 604, + STR_TIME_SET = 605, + STR_FORMAT = 606, + STR_FORMAT_NOTE = 607, + STR_SLEEP_UPDATE = 608, + STR_CAMERA = 609, + STR_GOAL_TITLE = 610, + STR_HEART_HIAGER = 611, + STR_CHARG_DOWN = 612, + STR_CHAEGING = 613, + STR_GOAL_DOWN = 614, + STR_OPERAT_FAIL = 615, + STR_DIAL_NOTE = 616, + STR_HEART_UNKOWN = 617, + STR_HEART_AVAILABLE = 618, + STR_HEART_JUST = 619, + STR_HEART_MIN_AGO = 620, + STR_HEART_HOUR_AGO = 621, + STR_RECORDS_20 = 622, + STR_RECORDS_NOTE = 623, + STR_RECORDS_DELETE = 624, + STR_NEW_INCOM = 625, + STR_NET_ERROR = 626, + STR_LANGUAGE_SELECTION_NOTE = 627, + STR_AUTO_OFF_BLUETOOTH_NOTE2 = 628, + STR_PHONE_MUSCI_NOTE = 629, + STR_TIME_FORMAT_SET = 630, + STR_DIAL_PLATE = 631, + STR_SLEEP_NOTIFY = 632, + STR_SLEEP_NOTE = 633, + STR_MAX_CARD = 634, + STR_NUM_LENGTH = 635, + STR_CALL_LIST = 636, + STR_DELETE_ALL = 637, + STR_FRE_CONTACT = 638, + STR_RECORD_MAX = 639, + STR_MAX_ID = 640, }; // UIResourceTextId enum FontLanguageId : uint8_t { diff --git a/code/sdk/application/wearable/fd230app/nativeui/add_card/src/AddCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/add_card/src/AddCardView.cpp index 2cc743c51..69feca90f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/add_card/src/AddCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/add_card/src/AddCardView.cpp @@ -127,7 +127,7 @@ namespace OHOS toastLabel_.SetPosition(77, 220); toastLabel_.Resize(454, 60); toastLabel_.SetViewId("toast"); - toastLabel_.SetText("卡片数量已经到达上限"); + // toastLabel_.SetTextId(STR_MAX_CARD);//可以不增加多国语言。目前没有该需求 toastLabel_.SetStyle(STYLE_BACKGROUND_COLOR, Color::Gray().full); toastLabel_.SetStyle(STYLE_BACKGROUND_OPA, 255); toastLabel_.SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmConfigView.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmConfigView.cpp index 4c7f8c224..78927fbfb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmConfigView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmConfigView.cpp @@ -13,6 +13,7 @@ #include "color.h" #include "ConfigModel.h" #include "ui_resource_string.h" +#include "languagecode/LanguageInit.h" namespace OHOS { #define SET_ALARM "编辑闹钟" @@ -401,7 +402,7 @@ namespace OHOS sprintf(showtime, "%02d:%02d", hour, min); // labelTime->SetTime24Hour(hour, min, 0); labelTime->SetText(showtime); - if (ConfigModel::GetInstance()->GetLanguage() == 0) + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) labelDay->SetText(weekStr.c_str()); else labelDay->SetText(weekStr_en.c_str()); diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp index 81dc01ecb..c53c176ed 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp @@ -11,6 +11,7 @@ #include "PhoneService.h" #include "ui_resource_string.h" #include "ConfigModel.h" +#include "languagecode/LanguageInit.h" namespace OHOS { static MainAlarmView *g_MainAlarmView = nullptr; @@ -424,7 +425,7 @@ void MainAlarmView::LabelGetWeek(uint8_t week, int16_t alarmNum) weekStr_en += SUN_DAY_EN; } } - if(ConfigModel::GetInstance()->GetLanguage() == 0) + if(ConfigModel::GetInstance()->GetLanguage() == ZH_CN) dLabel[alarmNum]->SetText(weekStr.c_str()); else dLabel[alarmNum]->SetText(weekStr_en.c_str()); diff --git a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantAnswerView.cpp b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantAnswerView.cpp index 6a48af947..4c1006955 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantAnswerView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantAnswerView.cpp @@ -287,7 +287,7 @@ void AssistantAnswerView::InitNoteLabel() { notelabel->SetViewId("notelabel"); notelabel->SetStyle(STYLE_TEXT_FONT, 30); //TODO:多国语言 - notelabel->SetText("试试对我说“打电话给某人”"); + notelabel->SetTextId(STR_CALLSOMEONE); notelabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); notelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); notelabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); diff --git a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantHfpView.cpp b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantHfpView.cpp index 96c99d945..3fdd70704 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantHfpView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantHfpView.cpp @@ -111,9 +111,7 @@ bool AssistantHfpView::CreateAssistantHfpViewLabel(void) { // } // TODO:多国语言 - InitLabel(noteLabel, 53, 230, 360, 105, "label", - "请打开通话蓝牙开关后使用语音助手功能", DEFAULT_VECTOR_FONT_FILENAME_EN, - 30); + InitLabelExt(noteLabel, 53, 230, 360, 105, "label", STR_BLUENOTE, DEFAULT_VECTOR_FONT_FILENAME_EN, 30); noteLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); noteLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); noteLabel->SetRollSpeed(70); diff --git a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantStartFailedView.cpp b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantStartFailedView.cpp index bf2b3ce55..b06321a17 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantStartFailedView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantStartFailedView.cpp @@ -81,7 +81,7 @@ UIScrollView *AssistantStartFailedView::CreateAssistantStartFailedView(void) { Label->SetPosition(53, 250, 360, 35); Label->SetStyle(STYLE_TEXT_FONT, 30); Label->SetStyle(STYLE_LINE_HEIGHT, 35); - Label->SetText("启用语音助手失败"); //启用语音助手失败 TODO::多国语言 + Label->SetTextId(STR_VOICE_FAIL); //启用语音助手失败 TODO::多国语言 Label->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); Label->SetTextColor(Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff)); Label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); diff --git a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantView.cpp b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantView.cpp index f91c6f512..0eb1685a7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantView.cpp @@ -87,7 +87,7 @@ void AssistantView::InitView() { AssistantScrollView[ASSISTANT_MAIN_VIEW]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); //初始化label TODO::多国语言 - InitLabel(noteLabel, 53, 339, 360, 35, "label", "点击唤醒语音助手", DEFAULT_VECTOR_FONT_FILENAME_EN, 30); + InitLabelExt(noteLabel, 53, 339, 360, 35, "label",STR_WAKE_VOIVE, DEFAULT_VECTOR_FONT_FILENAME_EN, 30); //初始化button InitButton(wakeButton, 128, 91, 210, 210, WAKE_ASSISTANT); wakeButton->SetImageSrc(WAKE_IMAGE, WAKE_IMAGE); diff --git a/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorView.cpp b/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorView.cpp index 7f5880616..e416bd277 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorView.cpp @@ -604,7 +604,7 @@ bool CalculatorView::Label_init() hint->SetStyle(STYLE_LINE_HEIGHT, 20); // Set additional property - hint->SetText("超过数字长度范围"); + hint->SetTextId(STR_NUM_LENGTH); hint->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); hint->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); hint->SetRollSpeed(0); diff --git a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp index a10b13b7f..113caff54 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp @@ -528,7 +528,7 @@ bool MulitplePhoneTextReplaces() return false; } - CallingView::GetInstance()->GetCallingDisplayLabel()->SetText("正在通话"); + // CallingView::GetInstance()->GetCallingDisplayLabel()->SetTextId(STR_CALLING); CallingView::GetInstance()->GetCallingDurationLabel()->SetText(""); return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogView.cpp b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogView.cpp index 8d4452510..6af814cc6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogView.cpp @@ -147,7 +147,7 @@ void CallerLogView::ChangeLabelsStytleLog() groupFirst->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); labelLog.SetPosition(0, APP_ITEM_FONT_SIZE, HORIZONTAL_RESOLUTION, ICON_X + NUM_20); - labelLog.SetText("通话记录"); + // labelLog.SetTextId(STR_CALL_LIST); labelLog.SetTextColor(Color::White()); labelLog.SetFont(DEFAULT_VECTOR_FONT_FILENAME, HEAD_END_FONT_SIZE); labelLog.SetAlign(TEXT_ALIGNMENT_CENTER); @@ -169,7 +169,7 @@ void CallerLogView::ChangeLabelsStytleClear(int32 groupFinaly, int32 Index) groupFinal->SetOnClickListener(clickLeftListener); labelClear.SetPosition(0, NUM_20, HORIZONTAL_RESOLUTION, APP_ITEM_BUTTON_HEIGHT); - labelClear.SetText("全部清除"); + // labelClear.SetTextId(STR_DELETE_ALL); labelClear.SetTextColor(Color::White()); labelClear.SetFont(DEFAULT_VECTOR_FONT_FILENAME, HEAD_END_FONT_SIZE); labelClear.SetAlign(TEXT_ALIGNMENT_CENTER); diff --git a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp index 77a5e4082..54cb4ebcd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp @@ -193,7 +193,7 @@ namespace OHOS //.text = "注:开启后10分钟没连接成功会自动关闭,因为传统蓝牙长时间打开会增加电耗,建议在有需要的时候使用(该功能主要用于电话拨打/通知、音乐控制/传输等)", // AttentionLabel->SetTextId(STR_AUTO_OFF_BLUETOOTH_NOTE); //TODO:多国语言 - AttentionLabel->SetText("注:开启后10分钟没连接成功会自动关闭,因为传统蓝牙长时间打开会增加耗电,建议在有需要的时候使用(该功能主要用于电话拨打/通知、音乐控制/传输等)"); + AttentionLabel->SetTextId(STR_AUTO_OFF_BLUETOOTH_NOTE2); AttentionLabel->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff)); AttentionLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); AttentionLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); // 断行模式。 diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalhint.cpp b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalhint.cpp index d695a879e..f13a0ef15 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalhint.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalhint.cpp @@ -76,7 +76,7 @@ namespace OHOS goalhintlabel->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - goalhintlabel->SetText("目标设置及更多数据请前往手机APP查看"); + // goalhintlabel->SetText("目标设置及更多数据请前往手机APP查看"); goalhintlabel->SetTextId(STR_GOAL_HINT); goalhintlabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); goalhintlabel->SetTextColor(Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff)); diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalother.cpp b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalother.cpp index f17ad650e..f83204fba 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalother.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalother.cpp @@ -234,7 +234,7 @@ namespace OHOS mileagegoalTitle->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - mileagegoalTitle->SetText("里程(KM)"); + // mileagegoalTitle->SetText("里程(KM)"); mileagegoalTitle->SetTextId(STR_MILEAGE); mileagegoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); mileagegoalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); @@ -251,7 +251,7 @@ namespace OHOS fatburninggoalTitle->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - fatburninggoalTitle->SetText("燃脂时间"); + // fatburninggoalTitle->SetText("燃脂时间"); fatburninggoalTitle->SetTextId(STR_FAT_BURNING_TIME); fatburninggoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); fatburninggoalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); @@ -267,7 +267,7 @@ namespace OHOS standgoalTitle->SetViewId("label1");// Set style standgoalTitle->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - standgoalTitle->SetText("站立次数"); + // standgoalTitle->SetText("站立次数"); standgoalTitle->SetTextId(STR_NUMBER_OF_STANDS); standgoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); standgoalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); @@ -283,7 +283,7 @@ namespace OHOS caloriegoalTitle->SetViewId("label1");// Set style caloriegoalTitle->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - caloriegoalTitle->SetText("消耗卡路里"); + // caloriegoalTitle->SetText("消耗卡路里"); caloriegoalTitle->SetTextId(STR_CONSUME_CALORIES); caloriegoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); caloriegoalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalview.cpp b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalview.cpp index 7458f5b92..5c7b978e9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalview.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalview.cpp @@ -156,7 +156,7 @@ namespace OHOS goalTitle->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - goalTitle->SetText("今日步数"); + // goalTitle->SetText("今日步数"); goalTitle->SetTextId(STR_STEPS_OF_THE_DAY); goalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); goalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartChartView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartChartView.cpp index 4438ac455..0f85e62f3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartChartView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartChartView.cpp @@ -435,6 +435,8 @@ void HeartChartView::InitChartLabel() { //上一次检测信息 InitLabel(lastheart_, 53, 130, 360, 35, "label", "--", DEFAULT_VECTOR_FONT_FILENAME_EN, 30); + lastheart_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + lastheart_->SetRollSpeed(70); //最小心率 不居中 InitLabelAdapt(minheart_, 293, 380, 200, 35, "label", "--", DEFAULT_VECTOR_FONT_FILENAME_EN, 35); diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp index 7a54b1594..8f55cea69 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp @@ -38,6 +38,7 @@ #include "battery_hal.h" #include "ui_service.h" +#include "languagecode/LanguageInit.h" #ifdef __cplusplus extern "C" { @@ -117,8 +118,8 @@ static void Notify(void *args, const Topic topic, Request *request) { return; } if (request->msgId == TOPIC_EVENT_HEARTRATE_UPDATA) { - GraphicService::GetInstance()->PostGraphicEvent(std::bind( - &HeartModel::RefreshHeartRateScreen, HeartModel::GetInstance())); + GraphicService::GetInstance()->PostGraphicEvent(std::bind( + &HeartModel::RefreshHeartRateScreen, HeartModel::GetInstance())); } } @@ -498,7 +499,8 @@ void HeartModel::Heart_Save() { #else HealthService::GetInstance()->send_heart_save(); // 将更新曲线写到这里提前更新 - HealthService::GetInstance()->UpdateHourlyHeartRate(timestamp_ms, currentheart); + HealthService::GetInstance()->UpdateHourlyHeartRate(timestamp_ms, + currentheart); #endif // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "保存的心率数据:%d%ld", // currentheart,data.timestamp); @@ -773,58 +775,74 @@ uint16_t *HeartModel::GetArrayData() { return dynamic_heartrate; } // 获取检测字符串 // 获取检测字符串 // TODO: 适配多国语言 -std::string HeartModel::GetCheckString() { - std::string check_string = "检测结果未知"; // 默认返回值 - - // 获取检测数据 - if (currentheart == 0) { - check_string = "暂无检测数据"; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "检测数据:%s", - check_string.c_str()); // 打印无检测数据信息 - return check_string; // 直接返回,无需继续处理 - } - - // 获取目前的时间戳 - uint32_t currentTime; - if (uapi_get_timestampe_ss(¤tTime) != ERRCODE_SUCC) { - check_string = "获取当前时间戳失败"; // 如果获取时间戳失败,返回相应的信息 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, - "获取当前时间戳失败"); // 打印错误信息 - return check_string; // 直接返回,无法进行后续计算 - } - - // 检查时间戳是否有效 - if (timestamp_ms == 0) { - check_string = std::to_string(currentheart) + " " + "时间戳无效,无法检测"; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "时间戳无效,无法检测:%s", - check_string.c_str()); - return check_string; // 直接返回,无需继续处理 - } - - // 进行时间戳相减计算 - uint32_t diff = currentTime - timestamp_ms; - uint32_t diff_min = diff / 60; // 计算分钟差 - uint32_t diff_hour = diff_min / 60; // 计算小时差 - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "当前时间:%d,上次检测时间:%d", - currentTime, timestamp_ms); // 打印时间信息 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, - "时间差(秒):%d,时间差(分钟):%d,时间差(小时):%d", diff, diff_min, - diff_hour); // 打印时间差信息 - - // 根据时间差生成检测字符串 - if (diff_min < 1) { - check_string = std::to_string(currentheart) + "次/分 " + "刚刚检测"; - } else if (diff_hour < 1) { // 一个小时内 - check_string = std::to_string(currentheart) + "次/分 " + - std::to_string(diff_min) + "分钟前"; - } else { - check_string = std::to_string(currentheart) + "次/分 " + "超过一个小时前"; - } - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "检测结果:%s", - check_string.c_str()); // 打印最终检测结果 - return check_string; +std::string HeartModel::GetCheckString() { + std::string check_string = "检测结果未知"; + + // 获取检测数据 + if (currentheart == 0) { + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) { + check_string = "暂无检测数据"; + } else { + check_string = "No detection data is available"; + } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "检测数据:%s", check_string.c_str()); + return check_string; + } + + // 获取目前的时间戳 + uint32_t currentTime; + if (uapi_get_timestampe_ss(¤tTime) != ERRCODE_SUCC) { + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) { + check_string = "获取当前时间失败"; + } else { + check_string = "Get time failed"; + } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "获取当前时间失败"); + return check_string; + } + + // 检查时间戳是否有效 + if (timestamp_ms == 0) { + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) { + check_string = std::to_string(currentheart) + " " + "时间无效,无法检测"; + } else { + check_string = std::to_string(currentheart) + " " + "Invalid time, cannot detect"; + } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "时间戳无效,无法检测:%s", check_string.c_str()); + return check_string; + } + + // 进行时间戳相减计算 + uint32_t diff = currentTime - timestamp_ms; + uint32_t diff_min = diff / 60; + uint32_t diff_hour = diff_min / 60; + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "当前时间:%d, 上次检测时间:%d", currentTime, timestamp_ms); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "时间差(秒):%d, 时间差(分钟):%d, 时间差(小时):%d", diff, diff_min, diff_hour); + + // 根据时间差生成检测字符串 + if (diff_min < 1) { + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) { + check_string = std::to_string(currentheart) + "次/分 " + "刚刚检测"; // + } else { + check_string = std::to_string(currentheart) + " bpm " + "Just detected"; + } + } else if (diff_hour < 1) { // Within one hour + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) { + check_string = std::to_string(currentheart) + "次/分 " + std::to_string(diff_min) + "分钟前"; + } else { + check_string = std::to_string(currentheart) + " bpm " + std::to_string(diff_min) + " minutes ago"; + } + } else { + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) { + check_string = std::to_string(currentheart) + "次/分 " + "超过一个小时前"; + } else { + check_string = std::to_string(currentheart) + " bpm " + "More than an hour ago"; + } + } + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "检测结果:%s", check_string.c_str()); + return check_string; // Return the final string } // 声明定时器变量 diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp index 0cf46bffa..86d717909 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp @@ -188,7 +188,7 @@ bool CallerDisplayView::InitUILabelDisplay() label_call_hint->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - label_call_hint->SetText("挂断/接听"); + // label_call_hint->SetText("挂断/接听"); label_call_hint->SetTextId(STR_HANG_UP_OR_ANSWER); label_call_hint->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp index 029743951..69f214afc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp @@ -221,7 +221,7 @@ bool WaitingHintsView::InitUILabelDisplay() label_call_hint->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - label_call_hint->SetText("挂断/接听"); + // label_call_hint->SetText("挂断/接听"); label_call_hint->SetTextId(STR_HANG_UP_OR_ANSWER); label_call_hint->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); @@ -243,12 +243,12 @@ bool WaitingHintsView::InitUILabelDisplay() // Set additional property if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) { - label_call_source->SetText("手表来电"); + // label_call_source->SetText("手表来电"); label_call_source->SetTextId(STR_WATCH_CALL); } else { - label_call_source->SetText("手机来电"); + // label_call_source->SetText("手机来电"); label_call_source->SetTextId(STR_PHONE_CALL); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirView.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirView.cpp index 88a7fd540..e858cc960 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirView.cpp @@ -375,7 +375,7 @@ namespace OHOS label1_no->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - label1_no->SetText("常用联系人"); + label1_no->SetTextId(STR_FRE_CONTACT); label1_no->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); label1_no->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); label1_no->SetRollSpeed(0); @@ -398,7 +398,7 @@ namespace OHOS label2_no->SetStyle(STYLE_TEXT_FONT, 26); // Set additional property - label2_no->SetText("未添加联系人,请前往APP进行设置"); + // label2_no->SetText("未添加联系人,请前往APP进行设置"); label2_no->SetTextId(STR_NO_CONTACTS_ADDED); label2_no->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); label2_no->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff)); @@ -468,7 +468,7 @@ namespace OHOS label1_->SetViewId("label1");// Set style label1_->SetStyle(STYLE_TEXT_FONT, 30); - label1_->SetText("常用联系人"); + label1_->SetTextId(STR_FRE_CONTACT); label1_->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); label1_->SetTextId(STR_FAVORITE_CONTACTS); //label1_->SetTextColor(Color::GetColorFromRGBA(0xac, 0xa4, 0xa4, 0xff)); diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/MusicPlayerTipView.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/MusicPlayerTipView.cpp index 12537a8f9..4973b3571 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/MusicPlayerTipView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/MusicPlayerTipView.cpp @@ -154,7 +154,8 @@ namespace OHOS noteLabel->SetPosition(53, 230, 360, 35); noteLabel->SetStyle(STYLE_TEXT_FONT, 30); noteLabel->SetStyle(STYLE_LINE_HEIGHT, 35); - noteLabel->SetText("手表正在播放手机音乐,不能对本地音乐进行操作。"); + // noteLabel->SetText("手表正在播放手机音乐,不能对本地音乐进行操作"); + noteLabel->SetTextId(STR_PHONE_MUSCI_NOTE); noteLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); noteLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); noteLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingNumLimitView.cpp b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingNumLimitView.cpp index 32e421644..e9d024294 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingNumLimitView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingNumLimitView.cpp @@ -154,7 +154,7 @@ namespace OHOS note->SetPosition(53, 222, 360, 70); // 位置大小 note->SetStyle(STYLE_TEXT_FONT, 30); // 字体大小 note->SetStyle(STYLE_LINE_HEIGHT, 35); // 字体行高 - note->SetText("录音空间已满"); + note->SetTextId(STR_RECORD_MAX); note->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); // 断行模式。 note->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); note->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); diff --git a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp index df25a4322..dc3e4b5e2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp @@ -543,7 +543,7 @@ namespace OHOS datelabel->SetViewId("label2"); datelabel->SetStyle(STYLE_TEXT_FONT, 30); - datelabel->SetText("04-22 周五"); + // datelabel->SetText("04-22 周五"); datelabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); datelabel->SetTextColor(Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff)); datelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); diff --git a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingView.cpp b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingView.cpp index 9f4eb8a27..3eb52ebfd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingView.cpp @@ -100,7 +100,7 @@ namespace OHOS label->SetStyle(STYLE_TEXT_FONT, 30); label->SetStyle(STYLE_LINE_HEIGHT, 35); // Set additional property - label->SetText("快速训练"); + // label->SetText("快速训练"); label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); label->SetRollSpeed(0); diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetCardDeleteView.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetCardDeleteView.cpp index d957515c8..195276e5f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetCardDeleteView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetCardDeleteView.cpp @@ -36,7 +36,7 @@ bool SetCardDeleteView::InitView() confirmBtn.SetPosition(184, 118); confirmBtn.Resize(86, 50); confirmBtn.SetViewId(SET_CARD_DEL_CONFIRM); - confirmBtn.SetText("删除"); + // confirmBtn.SetText("删除"); confirmBtn.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); confirmBtn.SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); confirmBtn.SetOnClickListener(presenter_); @@ -44,7 +44,7 @@ bool SetCardDeleteView::InitView() cancelBtn.SetPosition(186, 231); cancelBtn.Resize(82, 50); cancelBtn.SetViewId(SET_CARD_DEL_CANCEL); - cancelBtn.SetText("取消"); + // cancelBtn.SetText("取消"); cancelBtn.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); cancelBtn.SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); cancelBtn.SetOnClickListener(presenter_); diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetCardNoCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetCardNoCardView.cpp index 15cb462b6..5ea913301 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetCardNoCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetCardNoCardView.cpp @@ -34,7 +34,7 @@ bool SetCardNoCardView::InitView() addBtn.SetPosition(184, 118); addBtn.Resize(86, 50); addBtn.SetViewId(SET_CARD_ADD); - addBtn.SetText("添加"); + // addBtn.SetText("添加"); addBtn.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); addBtn.SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); addBtn.SetOnClickListener(presenter_); diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_time_format/src/SetTimeFormatView.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_time_format/src/SetTimeFormatView.cpp index f87a67a70..941119455 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_time_format/src/SetTimeFormatView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_time_format/src/SetTimeFormatView.cpp @@ -48,7 +48,7 @@ void SetTimeFormatView::OnSetUpView() { labelTitle_.SetPosition(83, 50, 300, 60); labelTitle_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); // labelTitle_.SetTextId(STR_BROWSING_SPECIAL_EFFECTS); - labelTitle_.SetText("时间设置"); // TODO:多国语言 + labelTitle_.SetTextId(STR_TIME_SET); // TODO:多国语言 labelTitle_.SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); // 居中 labelTitle_.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); container_->Add(&labelTitle_); @@ -56,7 +56,7 @@ void SetTimeFormatView::OnSetUpView() { labelFormat24H_.SetPosition(90, 153, 200, 60); labelFormat24H_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); // labelFormat24H_.SetTextId(STR_OVERLAY_FLOW); - labelFormat24H_.SetText("24小时制"); // TODO:多国语言 + labelFormat24H_.SetTextId(STR_FORMAT); // TODO:多国语言 container_->Add(&labelFormat24H_); btnFormat24H_.SetPosition(298, 145, 100, 50); @@ -66,7 +66,7 @@ void SetTimeFormatView::OnSetUpView() { labelNote_.SetPosition(53, 240, 360, 100); labelNote_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); - labelNote_.SetText("注: 开启为24小时制显示,关闭则按照12小时制显示"); + labelNote_.SetTextId(STR_FORMAT_NOTE); container_->Add(&labelNote_); const TimeFormat style = SetTimeFormatModel::GetInstance().GetTimeStyle(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepNapView.cpp b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepNapView.cpp index b229224e1..d11921f95 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepNapView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepNapView.cpp @@ -95,7 +95,7 @@ bool SleepNapView::InitPage(void) { /* -------------------------------- title初始化 * -------------------------------- */ //TODO:多国语言 - InitLabel(naptitle, 83, 90, 300, 35, "resttitle", "小睡数据", + InitLabelExt(naptitle, 83, 90, 300, 35, "resttitle",STR_NAP, DEFAULT_VECTOR_FONT_FILENAME_EN, 30); InitLabelExt(napsleeptitle, 21, 203, 200, 35, "sleeptitle", STR_SLEEPTIME, DEFAULT_VECTOR_FONT_FILENAME, 30); diff --git a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepView.cpp b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepView.cpp index 45072283e..d1765d515 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepView.cpp @@ -1,244 +1,235 @@ #include "sleep/include/SleepView.h" #include "ConfigModel.h" -#include "sleep/include/SleepModel.h" #include "common/image_cache_manager.h" +#include "languagecode/LanguageInit.h" +#include "sleep/include/SleepModel.h" #include "uicomponents/UIComponents.h" -namespace OHOS -{ - static constexpr char *roomimagePath = "/user/res/Sleep/room.bin"; - static constexpr char *upimagePath = "/user/res/Sleep/up.bin"; - static constexpr const char *prossimagePath = "/user/res/step/step_b.bin"; - - static SleepView *g_pSleepView{nullptr}; - SleepView::SleepView() - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SleepView::SleepView"); - SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - SetViewIndex(0); // 视图索引 - - g_pSleepView = this; - } - - SleepView::~SleepView() - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " SleepView::~SleepView"); - ClearAll(); - - g_pSleepView = nullptr; - } - - void SleepView::SleepDataRefresh() - { - // 获取睡眠数据内存 - SleepModel &sleepModel = SleepModel::GetInstance(); - sleepModel.ReInitData(); - - int sleep_hour = sleepModel.get_sleep_hour(); - int sleep_min = sleepModel.get_sleep_min(); - int total_sleep = sleepModel.get_sleep_total(); - int sleep_goal = sleepModel.get_sleep_goal(); - - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SleepDataRefresh %d %d sleep_goal:%d total_sleep:%d", sleep_hour, sleep_min, sleep_goal * 60, total_sleep); - - // 补零操作 - std::string hour_str = (sleep_hour < 10) ? "0" + std::to_string(sleep_hour) : std::to_string(sleep_hour); - std::string min_str = (sleep_min < 10) ? "0" + std::to_string(sleep_min) : std::to_string(sleep_min); - - // 有数据才刷新 - if (sleep_hour != 0 || sleep_min != 0) - { - // 更新时间显示 - if (time_hour != nullptr) - { - time_hour->SetText(hour_str.c_str()); - } - if (time_minute != nullptr) - { - time_minute->SetText(min_str.c_str()); - } - - // 计算进度百分比,确保目标睡眠时间不为零 - float progress_value = 0.0f; - if (sleep_goal > 0) - { - progress_value = static_cast(total_sleep) / (sleep_goal * 60); // 计算进度 - } - - // 日志输出进度百分比 - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Progress value: %.2f%%", progress_value * 100); // 显示为百分比 - - // 更新进度条 - circleProgress_->SetValue(progress_value * 100); // 更新进度条值,范围为 0 到 100 - circleProgress_->SetCapType(CAP_ROUND); - } - // 更新时间 - if (sleep_update_time != nullptr) - { - std::string update_time = sleepModel.GetUpdateSleepTime(); - if (!update_time.empty()) // 检查返回值是否有效 - { - //TODO:多国语言 - std::string update_time_str = update_time + " 更新"; // 拼接字符串 - sleep_update_time->SetText(update_time_str.c_str()); - // UpdateLabel(sleep_update_time, sleep_goal, STR_SLEEPMGOAL); // TODO: 多国语言支持 - } - } - // 刷新视图 - RootView::GetInstance()->Invalidate(); - } - - void SleepView::ClearAll() - { - RemoveAll(); - if (circleProgress_ != nullptr) - { - delete circleProgress_; - circleProgress_ = nullptr; - } - if (title != nullptr) - { - delete title; - title = nullptr; - } - if (hour != nullptr) - { - delete hour; - hour = nullptr; - } - if (minute != nullptr) - { - delete minute; - minute = nullptr; - } - if (time_hour != nullptr) - { - delete time_hour; - time_hour = nullptr; - } - if (time_minute != nullptr) - { - delete time_minute; - time_minute = nullptr; - } - if (sleep_update_time != nullptr) - { - delete sleep_update_time; - sleep_update_time = nullptr; - } - if (roomimage != nullptr) - { - delete roomimage; - roomimage = nullptr; - } - if (upiconimage != nullptr) - { - delete upiconimage; - upiconimage = nullptr; - } - if (progress_image != nullptr) - { - delete progress_image; - progress_image = nullptr; - } - } - - SleepView *SleepView::GetInstance() - { - return g_pSleepView; +namespace OHOS { +static constexpr char *roomimagePath = "/user/res/Sleep/room.bin"; +static constexpr char *upimagePath = "/user/res/Sleep/up.bin"; +static constexpr const char *prossimagePath = "/user/res/step/step_b.bin"; + +static SleepView *g_pSleepView{nullptr}; +SleepView::SleepView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SleepView::SleepView"); + SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + SetViewIndex(0); // 视图索引 + + g_pSleepView = this; +} + +SleepView::~SleepView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " SleepView::~SleepView"); + ClearAll(); + + g_pSleepView = nullptr; +} + +void SleepView::SleepDataRefresh() { + // 获取睡眠数据内存 + SleepModel &sleepModel = SleepModel::GetInstance(); + sleepModel.ReInitData(); + + int sleep_hour = sleepModel.get_sleep_hour(); + int sleep_min = sleepModel.get_sleep_min(); + int total_sleep = sleepModel.get_sleep_total(); + int sleep_goal = sleepModel.get_sleep_goal(); + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, + "SleepDataRefresh %d %d sleep_goal:%d total_sleep:%d", + sleep_hour, sleep_min, sleep_goal * 60, total_sleep); + + // 补零操作 + std::string hour_str = (sleep_hour < 10) ? "0" + std::to_string(sleep_hour) + : std::to_string(sleep_hour); + std::string min_str = (sleep_min < 10) ? "0" + std::to_string(sleep_min) + : std::to_string(sleep_min); + + // 有数据才刷新 + if (sleep_hour != 0 || sleep_min != 0) { + // 更新时间显示 + if (time_hour != nullptr) { + time_hour->SetText(hour_str.c_str()); } - - /*初始化界面*/ - bool SleepView::InitPage(void) - { - /*初始化title*/ - InitLabelExt(title, 83, 50, 300, 35, "labletitle", STR_SLEEP_YESTERDAY, DEFAULT_VECTOR_FONT_FILENAME, 30); - /*初始化单位*/ - InitLabelExt(hour, 157, 246, 75, 75, "lablehour", STR_HOUR, DEFAULT_VECTOR_FONT_FILENAME, 26); - hour->SetTextColor(Color::Gray()); - InitLabelExt(minute, 295, 246, 100, 75, "lableminute", STR_MIN, DEFAULT_VECTOR_FONT_FILENAME, 26); - minute->SetTextColor(Color::Gray()); - /*初始化image*/ - InitImageView(roomimage, 192, 127, 82, 82, "image", roomimagePath); - InitImageView(upiconimage, 213, 420, 40, 40, "image", upimagePath); - InitImageView(progress_image, 28, 80, 100, 100, "image", prossimagePath); - /*初始化目标时间*/ - //DEFAULT_VECTOR_FONT_FILENAME_EN - InitLabelExt(sleep_update_time, 83, 330, 300, 35, "lablegoal", STR_SLEEPMGOAL, DEFAULT_VECTOR_FONT_FILENAME_EN, 30); - sleep_update_time->SetTextColor(Color::Gray()); - /*初始化睡眠时间*/ - time_hour = new UILabel(); - time_hour->SetPosition(84, 237); - time_hour->Resize(40, 75); - time_hour->SetViewId("time_hour"); - time_hour->SetText("--"); - time_hour->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - time_hour->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - time_hour->SetFont(GILROY_BOLD_FONT, 65); - - time_minute = new UILabel(); - time_minute->SetPosition(240, 237); - time_minute->Resize(40, 75); - time_minute->SetViewId("time_minute"); - time_minute->SetText("--"); - time_minute->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - time_minute->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - time_minute->SetFont(GILROY_BOLD_FONT, 65); - /* --------------------------------- 初始化进度条 --------------------------------- */ - circleProgress_ = new UICircleProgress(); - if (circleProgress_ == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "circleProgress new fail"); - return false; - } - circleProgress_->SetPosition(0, 0); - circleProgress_->Resize(466, 466); - circleProgress_->SetViewId("circleProgress1"); - circleProgress_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - circleProgress_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - circleProgress_->SetBackgroundStyle(STYLE_BACKGROUND_OPA, 0x00); - circleProgress_->SetBackgroundStyle(STYLE_BORDER_OPA, 0x00); - circleProgress_->SetBackgroundStyle(STYLE_LINE_OPA, 0x00); - circleProgress_->SetForegroundStyle(STYLE_BACKGROUND_COLOR, 0xff2195F6); - circleProgress_->SetForegroundStyle(STYLE_BORDER_COLOR, 0xff000000); - circleProgress_->SetForegroundStyle(STYLE_LINE_COLOR, 0xff5320e2); - circleProgress_->SetForegroundStyle(STYLE_LINE_WIDTH, 20); - circleProgress_->SetCenterPosition(233, 229); - circleProgress_->SetRadius(205); - circleProgress_->SetStartAngle(320); - circleProgress_->SetEndAngle(40); - circleProgress_->SetCapType(CAP_ROUND); - /* -------------------------------- 将组件添加到根视图 ------------------------------- */ - Add(progress_image); - Add(circleProgress_); - Add(title); - Add(hour); - Add(minute); - Add(time_hour); - Add(time_minute); - Add(sleep_update_time); - Add(upiconimage); - Add(roomimage); - - viewInitStatus = true; - return true; + if (time_minute != nullptr) { + time_minute->SetText(min_str.c_str()); } - bool SleepView::InitView(void *caller) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SleepView InitView %p", caller); - if (InitPage() == false) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SleepView::InitPage fail"); - return false; - } - SleepDataRefresh(); // 刷新数据 - SetDraggable(true); - SetTouchable(true); - return true; + // 计算进度百分比,确保目标睡眠时间不为零 + float progress_value = 0.0f; + if (sleep_goal > 0) { + progress_value = + static_cast(total_sleep) / (sleep_goal * 60); // 计算进度 } - bool SleepView::GetInitViewState(void) + // 日志输出进度百分比 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Progress value: %.2f%%", + progress_value * 100); // 显示为百分比 + + // 更新进度条 + circleProgress_->SetValue(progress_value * + 100); // 更新进度条值,范围为 0 到 100 + circleProgress_->SetCapType(CAP_ROUND); + } + // 更新时间 + if (sleep_update_time != nullptr) { + std::string update_time = sleepModel.GetUpdateSleepTime(); + if (!update_time.empty()) // 检查返回值是否有效 { - return viewInitStatus; + std::string update_time_str; + // TODO:多国语言 + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) { + update_time_str = update_time + " 更新"; + } + else { + update_time_str = update_time + " update"; + } + sleep_update_time->SetText(update_time_str.c_str()); + // UpdateLabel(sleep_update_time, sleep_goal, STR_SLEEPMGOAL); // TODO: + // 多国语言支持 } -} \ No newline at end of file + } + // 刷新视图 + RootView::GetInstance()->Invalidate(); +} + +void SleepView::ClearAll() { + RemoveAll(); + if (circleProgress_ != nullptr) { + delete circleProgress_; + circleProgress_ = nullptr; + } + if (title != nullptr) { + delete title; + title = nullptr; + } + if (hour != nullptr) { + delete hour; + hour = nullptr; + } + if (minute != nullptr) { + delete minute; + minute = nullptr; + } + if (time_hour != nullptr) { + delete time_hour; + time_hour = nullptr; + } + if (time_minute != nullptr) { + delete time_minute; + time_minute = nullptr; + } + if (sleep_update_time != nullptr) { + delete sleep_update_time; + sleep_update_time = nullptr; + } + if (roomimage != nullptr) { + delete roomimage; + roomimage = nullptr; + } + if (upiconimage != nullptr) { + delete upiconimage; + upiconimage = nullptr; + } + if (progress_image != nullptr) { + delete progress_image; + progress_image = nullptr; + } +} + +SleepView *SleepView::GetInstance() { return g_pSleepView; } + +/*初始化界面*/ +bool SleepView::InitPage(void) { + /*初始化title*/ + InitLabelExt(title, 83, 50, 300, 35, "labletitle", STR_SLEEP_YESTERDAY, + DEFAULT_VECTOR_FONT_FILENAME, 30); + /*初始化单位*/ + InitLabelExt(hour, 157, 246, 75, 75, "lablehour", STR_HOUR, + DEFAULT_VECTOR_FONT_FILENAME, 26); + hour->SetTextColor(Color::Gray()); + InitLabelExt(minute, 295, 246, 100, 75, "lableminute", STR_MIN, + DEFAULT_VECTOR_FONT_FILENAME, 26); + minute->SetTextColor(Color::Gray()); + /*初始化image*/ + InitImageView(roomimage, 192, 127, 82, 82, "image", roomimagePath); + InitImageView(upiconimage, 213, 420, 40, 40, "image", upimagePath); + InitImageView(progress_image, 28, 80, 100, 100, "image", prossimagePath); + /*初始化目标时间*/ + // DEFAULT_VECTOR_FONT_FILENAME_EN + InitLabelExt(sleep_update_time, 83, 330, 300, 35, "lablegoal", STR_SLEEPMGOAL, + DEFAULT_VECTOR_FONT_FILENAME_EN, 30); + sleep_update_time->SetTextColor(Color::Gray()); + /*初始化睡眠时间*/ + time_hour = new UILabel(); + time_hour->SetPosition(84, 237); + time_hour->Resize(40, 75); + time_hour->SetViewId("time_hour"); + time_hour->SetText("--"); + time_hour->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + time_hour->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + time_hour->SetFont(GILROY_BOLD_FONT, 65); + + time_minute = new UILabel(); + time_minute->SetPosition(240, 237); + time_minute->Resize(40, 75); + time_minute->SetViewId("time_minute"); + time_minute->SetText("--"); + time_minute->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + time_minute->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + time_minute->SetFont(GILROY_BOLD_FONT, 65); + /* --------------------------------- 初始化进度条 + * --------------------------------- */ + circleProgress_ = new UICircleProgress(); + if (circleProgress_ == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "circleProgress new fail"); + return false; + } + circleProgress_->SetPosition(0, 0); + circleProgress_->Resize(466, 466); + circleProgress_->SetViewId("circleProgress1"); + circleProgress_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + circleProgress_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + circleProgress_->SetBackgroundStyle(STYLE_BACKGROUND_OPA, 0x00); + circleProgress_->SetBackgroundStyle(STYLE_BORDER_OPA, 0x00); + circleProgress_->SetBackgroundStyle(STYLE_LINE_OPA, 0x00); + circleProgress_->SetForegroundStyle(STYLE_BACKGROUND_COLOR, 0xff2195F6); + circleProgress_->SetForegroundStyle(STYLE_BORDER_COLOR, 0xff000000); + circleProgress_->SetForegroundStyle(STYLE_LINE_COLOR, 0xff5320e2); + circleProgress_->SetForegroundStyle(STYLE_LINE_WIDTH, 20); + circleProgress_->SetCenterPosition(233, 229); + circleProgress_->SetRadius(205); + circleProgress_->SetStartAngle(320); + circleProgress_->SetEndAngle(40); + circleProgress_->SetCapType(CAP_ROUND); + /* -------------------------------- 将组件添加到根视图 + * ------------------------------- */ + Add(progress_image); + Add(circleProgress_); + Add(title); + Add(hour); + Add(minute); + Add(time_hour); + Add(time_minute); + Add(sleep_update_time); + Add(upiconimage); + Add(roomimage); + + viewInitStatus = true; + return true; +} + +bool SleepView::InitView(void *caller) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SleepView InitView %p", caller); + if (InitPage() == false) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SleepView::InitPage fail"); + return false; + } + SleepDataRefresh(); // 刷新数据 + SetDraggable(true); + SetTouchable(true); + return true; +} + +bool SleepView::GetInitViewState(void) { return viewInitStatus; } +} // namespace OHOS \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp index 1ab069be3..0b9c6b5b0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp @@ -134,10 +134,7 @@ namespace OHOS label->SetPosition(labelconfig.left, labelconfig.top, labelconfig.width, labelconfig.height); label->SetStyle(STYLE_TEXT_FONT, labelconfig.fontSize); label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh); - if (labelconfig.textId == STR_TIME) - label->SetText("时间格式设置"); - else - label->SetTextId(labelconfig.textId); + label->SetTextId(labelconfig.textId); label->SetLineBreakMode(labelconfig.lineBreakMode); label->SetRollSpeed(70); label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize); @@ -175,7 +172,7 @@ namespace OHOS LabelSetup labelSetups[] = { {153, STR_ABOUT_WATCH}, // {273, STR_SYSTEM_UPDATE}, - {273, STR_TIME}, + {273, STR_TIME_FORMAT_SET}, {393, STR_WATCH_QR_CODE}, {513, STR_SYSTEM_LANGUAGE}, {633, STR_RESTART}, diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosView.h b/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosView.h index 66e5bd781..e19564e7a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosView.h @@ -70,7 +70,7 @@ namespace OHOS /*拍照提醒界面*/ UIScrollView *creamView{nullptr}; UILabelExt *labeltitle_ = nullptr; - UILabel *labelnote_ = nullptr; + UILabelExt *labelnote_ = nullptr; UILabelButtonExt *buttongo = nullptr; UIImageAnimatorView *creamAnimator{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp index d993ac9ab..9ce58cd96 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp @@ -182,7 +182,7 @@ void TakephotosView::ShowCreamView() { DEFAULT_VECTOR_FONT_FILENAME, 30); // 设置标签的位置和大小 - labelnote_ = new UILabel(); + labelnote_ = new UILabelExt(); labelnote_->SetPosition(53, 250); labelnote_->Resize(360, 200); // 设置标签的视图 ID @@ -194,7 +194,7 @@ void TakephotosView::ShowCreamView() { labelnote_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); labelnote_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); // SetLabelId(labelnote_, STR_TACK); - labelnote_->SetText("请先打开app,进入“设备”-“遥控拍照”");//TODO:多国语言 + labelnote_->SetTextId(STR_CAMERA);//TODO:多国语言 /*初始化按键*/ InitButtonExt(buttongo, 0, 366, 466, 100, BUTTONGO, STR_KONW, 30); diff --git a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleView.cpp b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleView.cpp index a1bd270f0..3941c3452 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleView.cpp @@ -131,15 +131,7 @@ namespace OHOS label->SetPosition(labelconfig.left, labelconfig.top, labelconfig.width, labelconfig.height); label->SetStyle(STYLE_TEXT_FONT, labelconfig.fontSize); label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh); - TOOD: - if(labelconfig.textId == STR_GRID_DISPLAY) { - if(ConfigModel::GetInstance()->GetLanguage() == 0) - label->SetText("拨号盘");//TODO::多国语言 - else - label->SetText("Dial plate");//TODO::多国语言 - }else{ - label->SetTextId(labelconfig.textId); - } + label->SetTextId(STR_DIAL_PLATE);//TODO::多国语言 label->SetLineBreakMode(labelconfig.lineBreakMode); label->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER); label->SetRollSpeed(70); diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp index 109bb4c0f..9bc3b28df 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp @@ -1259,14 +1259,14 @@ bool TraingModel::SaveSportData() { // 保存心率表 if (!SaveHeartTable()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SaveHeartRateData is error!"); - uapi_dev_runtime_set_train_storage_status(0); // 恢复状态 - return false; + // uapi_dev_runtime_set_train_storage_status(0); // 恢复状态 + // return false; } // 保存速度表 if (!SavePaceTable()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SaveSpeedData is error!"); - uapi_dev_runtime_set_train_storage_status(0); // 恢复状态 - return false; + // uapi_dev_runtime_set_train_storage_status(0); // 恢复状态 + // return false; } } @@ -1647,7 +1647,7 @@ void TraingModel::SendLiveDataIfNecessary() { // 检查自动获取的配置 app发起 if (user_autoget && Openingway) { // 发送实时数据 - if (g_motionTimes % user_freq == 0) { + if (g_motionTimes % 1 == 0) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SendLiveData is OK\r\n"); SendLiveData(); // 发送实时数据 } diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp index 7f685b422..223a54979 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp @@ -16,9 +16,11 @@ #include "ConfigModel.h" #include "custom_utils.h" +#include "languagecode/LanguageInit.h" #include "traing/include/TraingModel.h" #include "uicomponents/UIComponents.h" + extern "C" { void InitTimer(); void DisableTimer(); @@ -857,8 +859,8 @@ void TraingCardView::ShowGetTagView() { // InitRollLabel(labeltitle, 83, 50, 300, 35, "label1", STR_GOAL_ACHIEVED, // DEFAULT_VECTOR_FONT_FILENAME, 35); // TODO:多国语言 - InitLabel(labeltitle, 83, 50, 300, 35, "label3", "本次训练目标已达成", - DEFAULT_VECTOR_FONT_FILENAME_EN, 35); + InitLabelExt(labeltitle, 83, 50, 300, 35, "label3", STR_GOAL_TITLE, + DEFAULT_VECTOR_FONT_FILENAME_EN, 35); labeltitle->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); labeltitle->SetRollSpeed(70); @@ -1042,7 +1044,13 @@ UILabelExt *TraingCardView::GetHeartMaxLabel() { return labelnote; } void TraingCardView::SetHeartMaxLabel(int maxheart) { if (maxheart == 0 || labelnote == nullptr) return; - std::string heartStr = "当前心率高于" + std::to_string(maxheart) + "次/分钟"; + std::string heartStr; + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) { + heartStr = "当前心率高于" + std::to_string(maxheart) + "次/分钟"; + } else { + heartStr = + "Current heart rate is above " + std::to_string(maxheart) + " bpm"; + } labelnote->SetText(heartStr.c_str()); } } // namespace OHOS diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp index 70d641f86..5b6e7c8d9 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp @@ -82,9 +82,9 @@ namespace OHOS // 更新充电状态标签 if (UILabel_Chargeing) { if (power == 100) { - UILabel_Chargeing->SetText("充电完成"); // TODO: 增加多国语言 + UILabel_Chargeing->SetTextId(STR_CHARG_DOWN); // TODO: 增加多国语言 } else { - UILabel_Chargeing->SetText("正在充电"); + UILabel_Chargeing->SetTextId(STR_CHAEGING); // UILabel_Chargeing->SetTextId(STR_CHARGE); } UILabel_Chargeing->Invalidate(); @@ -507,7 +507,7 @@ namespace OHOS alarm_UILabel->SetPosition(110, 252); // widget's left position and top position alarm_UILabel->Resize(245, 70); // widget's width and height - alarm_UILabel->SetText("当前电量低于10%请及时充电"); + // alarm_UILabel->SetText("当前电量低于10%请及时充电"); alarm_UILabel->SetTextId(STR_LOW_POWER_NOTIF_1); alarm_UILabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); @@ -557,7 +557,7 @@ namespace OHOS const char *ImgSrc = "/user/res/466x100button.bin"; alarm_labelbutton->SetImageSrc(ImgSrc, ImgSrc); // Set additional property - alarm_labelbutton->SetText("确认"); + // alarm_labelbutton->SetText("确认"); alarm_labelbutton->SetTextId(STR_KONW); alarm_labelbutton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); alarm_labelbutton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp index fe5dfb591..67274d537 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp @@ -361,8 +361,8 @@ namespace OHOS // 初始化Lable // InitRollLabel(labeltitle, 83, 50, 300, 35, "label1", STR_GOAL_ACHIEVED, DEFAULT_VECTOR_FONT_FILENAME, 35); // TODO:多国语言 - InitLabel(labeltitle, 83, 50, 300, 35, "label3", - "今日活动目标已达成", DEFAULT_VECTOR_FONT_FILENAME_EN, + InitLabelExt(labeltitle, 83, 50, 300, 35, "label3", + STR_GOAL_DOWN, DEFAULT_VECTOR_FONT_FILENAME_EN, 35); labeltitle->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); labeltitle->SetRollSpeed(70); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp index fd7f745f4..e7713095c 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp @@ -74,19 +74,19 @@ namespace OHOS /*获取最新sleep*/ SLEEPSTATE sleepsate = SleepModel::GetInstance().get_sleep_state(); // TODO:适配多国语言 - // UIResourceTextId textId = STR_MORNNING; - std::string sleep_note; + UIResourceTextId textId = STR_MORNNING; + // std::string sleep_note; switch (sleepsate) { case SLEEPSTATE::SLEEPNOTIFY: titleStr = SleepModel::GetInstance().get_notifiy(); - // textId = STR_DISTURB; // 即将开启勿扰 - sleep_note = "手表将在20分钟后开启睡眠模式,关闭请到控制中心"; + textId = STR_SLEEP_NOTIFY; // 即将开启勿扰 + // sleep_note = "手表将在20分钟后开启睡眠模式,关闭请到控制中心"; break; case SLEEPSTATE::SLEPP: titleStr = SleepModel::GetInstance().get_sleep_notifiy(); - // textId = STR_DISTURBNOTE; - sleep_note = "已开启睡眠模式,此模式下手表将关闭所有提醒功能"; + textId = STR_SLEEP_NOTE; + // sleep_note = "已开启睡眠模式,此模式下手表将关闭所有提醒功能"; break; case SLEEPSTATE::WAKE: titleStr = SleepModel::GetInstance().get_wake_notifiy(); @@ -128,8 +128,8 @@ namespace OHOS } sleepnotifylabel->SetPosition(53, 220, 360, 144); sleepnotifylabel->SetViewId("sleepnotifylabel"); - // sleepnotifylabel->SetTextId(textId); - sleepnotifylabel->SetText(sleep_note.c_str()); + sleepnotifylabel->SetTextId(textId); + // sleepnotifylabel->SetText(sleep_note.c_str()); sleepnotifylabel->SetTextColor(Color::Gray()); sleepnotifylabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 30); sleepnotifylabel->SetLineBreakMode(UILabel::LINE_BREAK_CLIP); // 换行裁剪 diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp index e0bd21606..f8ee4872b 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp @@ -753,7 +753,7 @@ namespace OHOS Title->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - Title->SetText("操作失败");//TODO:多国语言 + Title->SetTextId(STR_OPERAT_FAIL);//TODO:多国语言 //Title->SetTextId (STR_DIAL_FAIL_TITLE); Title->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); @@ -775,7 +775,7 @@ namespace OHOS // Set additional property - label_->SetText("离线表盘个数已经超过最大或内存不足 请到app删除部分表盘再进行下载");//TODO:多国语言 + label_->SetTextId(STR_DIAL_NOTE);//TODO:多国语言 label_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); label_->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff)); diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang index 7a9e02a15..7ad41e7c7 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h index 8dfb7f5d6..8c60a072a 100644 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h @@ -611,7 +611,46 @@ enum UIResourceTextId : uint16_t { STR_DIAL_FAIL_LABEL = 598, STR_MP3_FAIL_TITL = 599, STR_MP3_FAIL_LABEL = 600, - STR_MAX_ID = 601, + STR_CALLSOMEONE = 601, + STR_BLUENOTE = 602, + STR_VOICE_FAIL = 603, + STR_WAKE_VOIVE = 604, + STR_TIME_SET = 605, + STR_FORMAT = 606, + STR_FORMAT_NOTE = 607, + STR_SLEEP_UPDATE = 608, + STR_CAMERA = 609, + STR_GOAL_TITLE = 610, + STR_HEART_HIAGER = 611, + STR_CHARG_DOWN = 612, + STR_CHAEGING = 613, + STR_GOAL_DOWN = 614, + STR_OPERAT_FAIL = 615, + STR_DIAL_NOTE = 616, + STR_HEART_UNKOWN = 617, + STR_HEART_AVAILABLE = 618, + STR_HEART_JUST = 619, + STR_HEART_MIN_AGO = 620, + STR_HEART_HOUR_AGO = 621, + STR_RECORDS_20 = 622, + STR_RECORDS_NOTE = 623, + STR_RECORDS_DELETE = 624, + STR_NEW_INCOM = 625, + STR_NET_ERROR = 626, + STR_LANGUAGE_SELECTION_NOTE = 627, + STR_AUTO_OFF_BLUETOOTH_NOTE2 = 628, + STR_PHONE_MUSCI_NOTE = 629, + STR_TIME_FORMAT_SET = 630, + STR_DIAL_PLATE = 631, + STR_SLEEP_NOTIFY = 632, + STR_SLEEP_NOTE = 633, + STR_MAX_CARD = 634, + STR_NUM_LENGTH = 635, + STR_CALL_LIST = 636, + STR_DELETE_ALL = 637, + STR_FRE_CONTACT = 638, + STR_RECORD_MAX = 639, + STR_MAX_ID = 640, }; // UIResourceTextId enum FontLanguageId : uint8_t { diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang index e042a1639..43b530bae 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang differ diff --git a/tools/language_tool/Language_xml/input_list_en.txt b/tools/language_tool/Language_xml/input_list_en.txt index d45e2e802..210818b8a 100644 --- a/tools/language_tool/Language_xml/input_list_en.txt +++ b/tools/language_tool/Language_xml/input_list_en.txt @@ -228,10 +228,10 @@ STR_DISTANCE$distance STR_RANGE_SETTING$Range setting(Km) STR_STEP_NUMBER$steps STR_STEP_SETTING$Step setting(steps) -STR_HEART_RATE_SETTING$Heart rate (times/min) +STR_HEART_RATE_SETTING$Heart rate (bmp) STR_MEAN_HEART_RATE$Mean heart rate -STR_TIMES_PER_MIN$Times/min -STR_MEAN_HEART_RATE_MIN$Mean heart rate(Times/min) +STR_TIMES_PER_MIN$bmp +STR_MEAN_HEART_RATE_MIN$Mean heart rate(bmp) STR_LOWER_STRENGTH$Lower strength STR_MEDIUM_STRENGTH$Medium strength STR_HIGH_STRENGTH$High strength @@ -295,8 +295,8 @@ STR_REATTIME$Schedule STR_SLEEPTIME$Bedtime STR_WALKTIME$Wake-up Time STR_APPMORE$For more details yesterday, please visit the mobile APP -STR_DISTURB$The watch will enter Do Not Disturb mode in 20 minutes. To turn it off, please go to the Control Center. -STR_DISTURBNOTE$Do Not Disturb mode is enabled, thus the watch won't vibrate or ring. +STR_DISTURB$The watch will enter Do Not Disturb mode in 20 minutes To turn it off, please go to the Control Center +STR_DISTURBNOTE$Do Not Disturb mode is enabled, thus the watch won't vibrate or ring STR_MORNNING$Good morning STR_NOW$Current STR_NAP$Nap (5 minutes) @@ -324,7 +324,7 @@ STR_SYSTEM_UPDATE$System Update STR_ONLINE_MUSIC$Online music STR_BLUETOOTH_HEADPHONES$Bluetooth Headphones STR_TRADITIONAL_BLUETOOTH$Traditional Bluetooth -STR_AUTO_OFF_BLUETOOTH_NOTE$Note: It will be automatically turned off if the connection is not successful for 10 minutes after opening, because the traditional Bluetooth will increase the power consumption for a long time, it is recommended to use when necessary(this function is mainly used for phone calls/notifications、music control/transmission, etc.) +STR_AUTO_OFF_BLUETOOTH_NOTE$Note: It will be automatically turned off if the connection is not successful for 10 minutes after opening, because the traditional Bluetooth will increase the power consumption for a long time, it is recommended to use when necessary(this function is mainly used for phone calls/notifications、music control/transmission, etc) STR_BLUETOOTH_SERVICE_OPTIONS$Bluetooth Service Options STR_HFP$Call Bluetooth STR_A2DP$Media Bluetooth @@ -355,17 +355,17 @@ STR_NO_UPDATE$No update STR_LANGUAGE_SELECTION$Language Select STR_RESET_CONFIRM$Are you sure to restart? STR_SHUTDOWN_CONFIRM$Are you sure to shut down? -STR_RESET_CONFIRM_NOTE$The operation will clear and reset the watch data. Are you sure you want to continue? +STR_RESET_CONFIRM_NOTE$The operation will clear and reset the watch data Are you sure you want to continue? STR_RECORDER$Recorder STR_CLICK_TO_RECORD$Click to record STR_RECORDING$Recording STR_AUDIO_XX$Audio_XX STR_VOICE_RECORDING_REMINDER$Voice recording reminder -STR_VOICE_RECORDING_REMINDER_NOTE$The number of recordings must not exceed 30. Please delete some existing recordings. +STR_VOICE_RECORDING_REMINDER_NOTE$The number of recordings must not exceed 30 Please delete some existing recordings STR_DELETE_RECORDING$Delete recording STR_DELETE_PERMANENTLY$Permanently Delete STR_RECORDING_LIST$Recording List -STR_CRLEMPTY$Current recording list is empty. +STR_CRLEMPTY$Current recording list is empty STR_DO_NOT_DISTURB_MODE$Turn on Do Not Disturb mode, the watch will not vibrate or ring, do you want to turn it on? STR_CONNECTION_STATUS$Connection Status STR_PHONE$Phone @@ -422,7 +422,7 @@ STR_DIAL_MODE$Dial Mode STR_DIAL_VIA_WATCH_SIM$Dial via Watch SIM STR_DIAL_VIA_PHONE$Dial via Phone STR_KUMI_TECHNOLOGY$KUMI Technology -STR_CALLING$Calling... +STR_CALLING$Calling STR_NOT_PAIRED$Not Paired STR_PAIRED$Paired STR_UNPAIR$Unpair @@ -430,8 +430,8 @@ STR_CONNECTION_ERROR$Connection Error STR_INSERT_WATCH_SIM_OR_CONNECT_PHONE$Insert watch SIM or connect phone to make calls STR_ENABLE_BLUETOOTH_CALL$Enable Bluetooth Call STR_SOLUTION$The solution: -STR_IPHONE$1.IPhone -STR_ANDROID$2.Android phone +STR_IPHONE$1IPhone +STR_ANDROID$2Android phone STR_ENABLE_BLUETOOTH_CALL_NOTE_IPHONE$Please go to the phone "Settings" → "Bluetooth" list to find XX Click and try again STR_ENABLE_BLUETOOTH_CALL_NOTE_ANDROID$Please go to the phone "Settings" → "Bluetooth" list to find XX Click the icon on the right to enter Bluetooth Settings Enable the call and media functions and try again STR_SIM_CARD_ERROR$SIM Card Error @@ -455,7 +455,7 @@ STR_EQUIPMENT_UNTYING_NOTE$XX would like to unbind you STR_DRINK_WATER_REMINDER$Drink water reminder STR_DRINK_WATER_REMINDER_NOTE$Time for some water! And stay hydrated STR_SEDENTARY_REMINDER$Sedentary reminder -STR_SEDENTARY_REMINDER_NOTE$You haven't moved for XX hours. Get up and move. +STR_SEDENTARY_REMINDER_NOTE$You haven't moved for XX hours Get up and move STR_SYSTEM_UPGRADING$System upgrading STR_NEWDEVICE_BIND_REMIND_NOTE1$The device has been bound to XX STR_NEWDEVICE_BIND_REMIND_NOTE2$Continuing to connect will unbind XX and restore the watch to factory Settings (will clear the watch data) @@ -508,7 +508,7 @@ STR_AVG_PACE$Average pace STR_TONGYI_QIANWEN$Tongyi Qianwen STR_IFLYTEK_SPARK$Xunfei Spark STR_DISTURBNOTE_OFF$Do not disturb mode is enabled or disabled -STR_4G_NOTE$After enabling this function, the watch can make calls with a 4G SIM card, and power consumption will increase. +STR_4G_NOTE$After enabling this function, the watch can make calls with a 4G SIM card, and power consumption will increase STR_MUSIC_PLAYER_SOURCE_NOTE$Please enter Music - Music Source from the watch app interface, set it to Mobile Mode and try again STR_MUSIC_LIST_IS_EMPTY$The current music list is empty, please download and add via APP STR_BT_HEADSET_RESCAN$Rescan @@ -552,7 +552,7 @@ STR_LOW_POWER_NOTIF_1$The current battery is below 10%, please charge it in time STR_LOW_POWER_NOTIF_2$When the battery is too low XXs will automatically shut down STR_CONNECTION_SUCC$Connection successful STR_RETRY$Retry -STR_BTEARPHONE_CONN_FAIL_TIP$Please confirm that the device is within the communication range and in the pairing-ready state. +STR_BTEARPHONE_CONN_FAIL_TIP$Please confirm that the device is within the communication range and in the pairing-ready state STR_FLASHLIGHT_SETTING$Flashlight settings STR_LIGHT_COLOR$Light color STR_FLICKER_FREQUENCY$Blinking frequency @@ -564,14 +564,14 @@ STR_OVERLAY_FLOW$Overlay flow STR_ROLLER$Roller STR_DIAL_BROWSING_SPECIAL_EFFECTS$Dial browsing special effects STR_SET_TARGET$Set target> -STR_PWUWC$Please wear the watch correctly and remain still. +STR_PWUWC$Please wear the watch correctly and remain still STR_CALENDAR$calendar STR_ALARM_DELETE_NOTE$Whether to delete the alarm STR_ALARM_TIME_CHANGE$Change time STR_ALARM_WEEK_CHANGE$Change week STR_ALARM_REPEAT$Repeat STR_ALARM_ADD_LIMIT_NOTE$The current number of alarm clocks has reached the upper limit -STR_MOTION_RECOGNITION_NOTE$After turning it on, the watch will send a reminder when it detects that you are in an exercise state. Supported exercises include: walking, running, cycling, rowing machine, and elliptical trainer. +STR_MOTION_RECOGNITION_NOTE$After turning it on, the watch will send a reminder when it detects that you are in an exercise state Supported exercises include: walking, running, cycling, rowing machine, and elliptical trainer STR_DURATION_SETTINGS$Duration settings STR_2_MIN$2min STR_3_MIN$3min @@ -582,20 +582,61 @@ STR_THREE_MIN$3min > STR_FOUR_MIN$4min > STR_FIVE_MIN$5min > STR_MUSIC_TRANSMIT$Music is being transferred -STR_MUSIC_TRANSMIT_NOTE$Music is being transferred. Please do not perform other operations or turn off the watch. -STR_MUSIC_TRANSMIT_SUCCESS_NOTE$Music transfer is successful and is being verified. Please wait. +STR_MUSIC_TRANSMIT_NOTE$Music is being transferred Please do not perform other operations or turn off the watch +STR_MUSIC_TRANSMIT_SUCCESS_NOTE$Music transfer is successful and is being verified Please wait STR_OTA_DOWNLOAD$OTA downloading STR_OTA_DOWNLOADING$Software is being updated STR_OTA_DOWNLOADFIAL$OTA download failed -STR_OTA_DOWNLOADFIAL_TRY$Downloading upgrade package failed. Please exit or redownload. +STR_OTA_DOWNLOADFIAL_TRY$Downloading upgrade package failed Please exit or redownload STR_OTA_DOWNLOADSUCC$OTA download succeeded -STR_OTA_DOWNLOADSUCC_UPDATA$Downloading upgrade package succeeded. You can start upgrading the watch. +STR_OTA_DOWNLOADSUCC_UPDATA$Downloading upgrade package succeeded You can start upgrading the watch STR_DIAL_DOWNLOADING_TITLE$Dial installation in progress -STR_DIAL_DOWNLOADING_LABEL$Dial is being installed. Please do not perform other operations or turn off the watch. +STR_DIAL_DOWNLOADING_LABEL$Dial is being installed Please do not perform other operations or turn off the watch STR_MP3_SUCC_TITLE$Transmission succeeded STR_DIAL_SUCC_TITLE$Installation succeeded -STR_DIAL_SUCC_LABEL$Dial installation succeeded. The dial is being updated. Please wait. +STR_DIAL_SUCC_LABEL$Dial installation succeeded The dial is being updated Please wait STR_DIAL_FAIL_TITLE$Installation failed -STR_DIAL_FAIL_LABEL$Dial installation failed. Please exit or reinstall. +STR_DIAL_FAIL_LABEL$Dial installation failed Please exit or reinstall STR_MP3_FAIL_TITL$Transmission failed -STR_MP3_FAIL_LABEL$Music transmission failed. Please exit or reinstall. \ No newline at end of file +STR_MP3_FAIL_LABEL$Music transmission failed Please exit or reinstall +STR_CALLSOMEONE$Try saying 'Call someone' to me +STR_BLUENOTE$Please turn on the call Bluetooth switch before using the voice assistant function +STR_VOICE_FAIL$Voice assistant activation failed +STR_WAKE_VOIVE$Click to wake up the voice assistant +STR_TIME_SET$Time setting +STR_FORMAT$24-hour format +STR_FORMAT_NOTE$Note: When enabled, it shows in 24-hour format; when disabled, it shows in 12-hour format +STR_NAP$Nap data +STR_SLEEP_UPDATE$XX update +STR_CAMERA$Please open the app first, and enter 'Device' - 'Remote Camera' +STR_GOAL_TITLE$The current training goal has been achieved +STR_HEART_HIAGER$The current heart rate is higher than XX beats per minute +STR_CHARG_DOWN$Charging completed +STR_CHAEGING$Charging in progress +STR_GOAL_DOWN$Today's activity goal has been achieved +STR_OPERAT_FAIL$Operation failed +STR_DIAL_NOTE$The number of offline watch faces has exceeded the maximum or the memory is insufficient Please delete some watch faces in the app and then download +STR_HEART_UNKOWN$Detection result unknown +STR_HEART_AVAILABLE$No detection data available +STR_HEART_JUST$XX beats per minute Just detected +STR_HEART_MIN_AGO$XX beats per minute XX minutes ago +STR_HEART_HOUR_AGO$XX beats per minute More than an hour ago +STR_RECORDS_20$Note: Only the latest 20 call records will be retained Long press on a call record to delete it +STR_RECORDS_NOTE$Whether to permanently delete this record +STR_RECORDS_DELETE$Delete record +STR_NEW_INCOM$New incoming call +STR_NET_ERROR$Network anomaly +STR_LANGUAGE_SELECTION_NOTE$The selected language takes effect after the restart +STR_AUTO_OFF_BLUETOOTH_NOTE2$Note: It will be automatically turned off if the connection is not successful for 10 minutes after opening, because the traditional Bluetooth will increase the power consumption for a long time, it is recommended to use when necessary (this function is mainly used for phone calls/notifications, music control/transmission, etc) +STR_PHONE_MUSCI_NOTE$The watch is playing mobile music and cannot operate local music +STR_TIME_FORMAT_SET$Time formatting +STR_DIAL_PLATE$Dial plate +STR_SLEEP_NOTIFY$The watch will turn on the sleep mode in 20 minutes Please go to the control center to turn it off +STR_SLEEP_NOTE$Sleep mode is enabled, in which the watch will turn off all reminder functions +STR_MAX_CARD$The number of cards has reached its limit +STR_NUM_LENGTH$The number length exceeds the range +STR_CALLING$On the phone +STR_CALL_LIST$Call log +STR_DELETE_ALL$Clear all +STR_FRE_CONTACT$Frequent contact +STR_RECORD_MAX$The recording space is full \ No newline at end of file diff --git a/tools/language_tool/Language_xml/input_list_zh.txt b/tools/language_tool/Language_xml/input_list_zh.txt index 2936779c6..9606f222e 100644 --- a/tools/language_tool/Language_xml/input_list_zh.txt +++ b/tools/language_tool/Language_xml/input_list_zh.txt @@ -598,4 +598,45 @@ STR_DIAL_SUCC_LABEL$表盘安装成功正在更新表盘,请稍等 STR_DIAL_FAIL_TITLE$安装失败 STR_DIAL_FAIL_LABEL$表盘安装失败,请退出或重新安装 STR_MP3_FAIL_TITL$传输失败 -STR_MP3_FAIL_LABEL$音乐传输失败,请退出或重新安装 \ No newline at end of file +STR_MP3_FAIL_LABEL$音乐传输失败,请退出或重新安装 +STR_CALLSOMEONE$试试对我说“打电话给某人” +STR_BLUENOTE$请打开通话蓝牙开关后使用语音助手功能 +STR_VOICE_FAIL$启用语音助手失败 +STR_WAKE_VOIVE$点击唤醒语音助手 +STR_TIME_SET$时间设置 +STR_FORMAT$24小时制 +STR_FORMAT_NOTE$注: 开启为24小时制显示,关闭则按照12小时制显示 +STR_NAP$小睡数据 +STR_SLEEP_UPDATE$XX更新 +STR_CAMERA$请先打开app,进入“设备”-“遥控拍照” +STR_GOAL_TITLE$本次训练目标已达成 +STR_HEART_HIAGER$当前心率高于XX次/分钟 +STR_CHARG_DOWN$充电完成 +STR_CHAEGING$正在充电 +STR_GOAL_DOWN$今日活动目标已达成 +STR_OPERAT_FAIL$操作失败 +STR_DIAL_NOTE$离线表盘个数已经超过最大或内存不足 请到app删除部分表盘再进行下载 +STR_HEART_UNKOWN$检测结果未知 +STR_HEART_AVAILABLE$暂无检测数据 +STR_HEART_JUST$XX次/分 刚刚检测 +STR_HEART_MIN_AGO$XX次/分 XX分钟前 +STR_HEART_HOUR_AGO$XX次/分 超过一个小时前 +STR_RECORDS_20$注:只保留最近20条通话记录\n在通话记录上长按可删除 +STR_RECORDS_NOTE$是否永久删除该条记录 +STR_RECORDS_DELETE$删除记录 +STR_NEW_INCOM$新来电 +STR_NET_ERROR$网络异常 +STR_LANGUAGE_SELECTION_NOTE$选择该语言需要重启后生效 +STR_AUTO_OFF_BLUETOOTH_NOTE2$注:开启后10分钟没连接成功会自动关闭,因为传统蓝牙长时间打开会增加耗电,建议在有需要的时候使用(该功能主要用于电话拨打/通知、音乐控制/传输等) +STR_PHONE_MUSCI_NOTE$手表正在播放手机音乐,不能对本地音乐进行操作 +STR_TIME_FORMAT_SET$时间格式设置 +STR_DIAL_PLATE$拨号盘 +STR_SLEEP_NOTIFY$手表将在20分钟后开启睡眠模式,关闭请到控制中心 +STR_SLEEP_NOTE$已开启睡眠模式,此模式下手表将关闭所有提醒功能 +STR_MAX_CARD$卡片数量已经到达上限 +STR_NUM_LENGTH$超过数字长度范围 +STR_CALLING$正在通话 +STR_CALL_LIST$通话记录 +STR_DELETE_ALL$全部清除 +STR_FRE_CONTACT$常用联系人 +STR_RECORD_MAX$录音空间已满 \ No newline at end of file diff --git a/tools/language_tool/Language_xml/language_custom.xlsx b/tools/language_tool/Language_xml/language_custom.xlsx index 83c194447..b7bc9d736 100644 Binary files a/tools/language_tool/Language_xml/language_custom.xlsx and b/tools/language_tool/Language_xml/language_custom.xlsx differ diff --git a/tools/language_tool/Language_xml/language_en.xml b/tools/language_tool/Language_xml/language_en.xml index 3f242aeca..ec02f9793 100644 --- a/tools/language_tool/Language_xml/language_en.xml +++ b/tools/language_tool/Language_xml/language_en.xml @@ -229,10 +229,10 @@ - + - - + + @@ -296,8 +296,8 @@ - - + + @@ -325,7 +325,7 @@ - + @@ -356,17 +356,17 @@ - + - + - + @@ -423,7 +423,7 @@ - + @@ -431,8 +431,8 @@ - - + + @@ -456,7 +456,7 @@ - + @@ -509,7 +509,7 @@ - + @@ -553,7 +553,7 @@ - + @@ -565,14 +565,14 @@ - + - + @@ -583,21 +583,62 @@ - - + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/language_tool/Language_xml/language_zh.xml b/tools/language_tool/Language_xml/language_zh.xml index 25f314651..e03d871df 100644 --- a/tools/language_tool/Language_xml/language_zh.xml +++ b/tools/language_tool/Language_xml/language_zh.xml @@ -600,4 +600,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/language_tool/font/en.lang b/tools/language_tool/font/en.lang index 7a9e02a15..7ad41e7c7 100644 Binary files a/tools/language_tool/font/en.lang and b/tools/language_tool/font/en.lang differ diff --git a/tools/language_tool/font/ui_resource_string.h b/tools/language_tool/font/ui_resource_string.h index 8dfb7f5d6..8c60a072a 100644 --- a/tools/language_tool/font/ui_resource_string.h +++ b/tools/language_tool/font/ui_resource_string.h @@ -611,7 +611,46 @@ enum UIResourceTextId : uint16_t { STR_DIAL_FAIL_LABEL = 598, STR_MP3_FAIL_TITL = 599, STR_MP3_FAIL_LABEL = 600, - STR_MAX_ID = 601, + STR_CALLSOMEONE = 601, + STR_BLUENOTE = 602, + STR_VOICE_FAIL = 603, + STR_WAKE_VOIVE = 604, + STR_TIME_SET = 605, + STR_FORMAT = 606, + STR_FORMAT_NOTE = 607, + STR_SLEEP_UPDATE = 608, + STR_CAMERA = 609, + STR_GOAL_TITLE = 610, + STR_HEART_HIAGER = 611, + STR_CHARG_DOWN = 612, + STR_CHAEGING = 613, + STR_GOAL_DOWN = 614, + STR_OPERAT_FAIL = 615, + STR_DIAL_NOTE = 616, + STR_HEART_UNKOWN = 617, + STR_HEART_AVAILABLE = 618, + STR_HEART_JUST = 619, + STR_HEART_MIN_AGO = 620, + STR_HEART_HOUR_AGO = 621, + STR_RECORDS_20 = 622, + STR_RECORDS_NOTE = 623, + STR_RECORDS_DELETE = 624, + STR_NEW_INCOM = 625, + STR_NET_ERROR = 626, + STR_LANGUAGE_SELECTION_NOTE = 627, + STR_AUTO_OFF_BLUETOOTH_NOTE2 = 628, + STR_PHONE_MUSCI_NOTE = 629, + STR_TIME_FORMAT_SET = 630, + STR_DIAL_PLATE = 631, + STR_SLEEP_NOTIFY = 632, + STR_SLEEP_NOTE = 633, + STR_MAX_CARD = 634, + STR_NUM_LENGTH = 635, + STR_CALL_LIST = 636, + STR_DELETE_ALL = 637, + STR_FRE_CONTACT = 638, + STR_RECORD_MAX = 639, + STR_MAX_ID = 640, }; // UIResourceTextId enum FontLanguageId : uint8_t { diff --git a/tools/language_tool/font/zh.lang b/tools/language_tool/font/zh.lang index e042a1639..43b530bae 100644 Binary files a/tools/language_tool/font/zh.lang and b/tools/language_tool/font/zh.lang differ