From: xue <2144439972@qq.com> Date: Tue, 3 Feb 2026 11:07:38 +0000 (+0800) Subject: GPS定位英文适配 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9daabed1759ccbe189fc826a3b1721b823898ed8;p=mirrors%2FFD230.git GPS定位英文适配 --- diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_GPS/src/TraingEphemerisNoteView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_GPS/src/TraingEphemerisNoteView.cpp index 27ba0af08..7d06855e2 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_GPS/src/TraingEphemerisNoteView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_GPS/src/TraingEphemerisNoteView.cpp @@ -5,7 +5,7 @@ #include "ui_resource_image.h" #include "uicomponents/UIComponents.h" #include "traing/Training_UiConfig.h" - +#include "ConfigModel.h" namespace OHOS { @@ -51,21 +51,34 @@ namespace OHOS // 初始化button - 去训练按钮 InitButtonExt(button_back, 118, 434, 230, 80, BUTTONTRAIN, STR_SET_TARGET, 30); - button_back->SetText("跳过优化"); + if(ConfigModel::GetInstance()->GetLanguage() == 0) + button_back->SetText("跳过优化"); + else + button_back->SetText("Skip Opt"); + scrollView1_->Add(button_back); button_back->SetOnClickListener(presenter_); // 初始化button - 去下载按钮 InitButtonExt(button_download, 118, 334, 230, 80, BUTTONDOWNLOAD, STR_EPHEMERIS_DOWNLOAD, 30); - button_download->SetText("连接手机"); + if(ConfigModel::GetInstance()->GetLanguage() == 0) + button_download->SetText("连接手机"); + else + button_download->SetText("Connect Phone"); button_download->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c); scrollView1_->Add(button_download); button_download->SetOnClickListener(presenter_); // 初始化Lable - 标题 - InitLabel(label1_, 133, 52, 200, 60, "label1", "定位优化", DEFAULT_VECTOR_FONT_FILENAME, 30); + if(ConfigModel::GetInstance()->GetLanguage() == 0) + InitLabel(label1_, 133, 52, 200, 60, "label1", "定位优化", DEFAULT_VECTOR_FONT_FILENAME, 30); + else + InitLabel(label1_, 133, 52, 200, 60, "label1", "Opt Positioning", DEFAULT_VECTOR_FONT_FILENAME, 30); // 初始化Lable - 说明文字 - InitLabel(label2_, 33, 215, 400, 90, "label2", "连接手机可获得更快定位", DEFAULT_VECTOR_FONT_FILENAME, 30); + if(ConfigModel::GetInstance()->GetLanguage() == 0) + InitLabel(label2_, 33, 215, 400, 90, "label2", "连接手机可获得更快定位", DEFAULT_VECTOR_FONT_FILENAME, 30); + else + InitLabel(label2_, 33, 215, 400, 90, "label2", "Connect Phone for Faster Positioning", DEFAULT_VECTOR_FONT_FILENAME, 30); scrollView1_->Add(label1_); scrollView1_->Add(label2_); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_GPS/src/TraingGPSnoteView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_GPS/src/TraingGPSnoteView.cpp index 29840d43a..4ebfc2afd 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_GPS/src/TraingGPSnoteView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_GPS/src/TraingGPSnoteView.cpp @@ -13,6 +13,7 @@ #include "traing/Training_UiConfig.h" #include "ui_resource_image.h" #include "components/root_view.h" +#include "ConfigModel.h" namespace OHOS { @@ -63,19 +64,32 @@ namespace OHOS // 初始化button InitButtonExt(button_wait, 118, 334, 230, 80, GPSBUTTONBACK, STR_SET_TARGET, 30); - button_wait->SetText("继续等待"); + if(ConfigModel::GetInstance()->GetLanguage() == 0) + button_wait->SetText("继续等待"); + else + button_wait->SetText("Continue Waiting"); + button_wait->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c); scrollView1_->Add(button_wait); button_wait->SetOnClickListener(presenter_); InitButtonExt(button_go, 118, 434, 230, 80, GPSBUTTONGO, STR_SET_TARGET, 30); - button_go->SetText("直接开始"); + if(ConfigModel::GetInstance()->GetLanguage() == 0) + button_go->SetText("直接开始"); + else + button_go->SetText("Start Directly"); scrollView1_->Add(button_go); button_go->SetOnClickListener(presenter_); // 初始化Lable - InitLabel(label1_, 133, 52, 200, 60, "label1", "GPS未准备", DEFAULT_VECTOR_FONT_FILENAME, 30); - InitLabel(label2_, 33, 215, 400, 90, "label2", "GPS仍在定位,建议等待定位 完成后再开始训练", DEFAULT_VECTOR_FONT_FILENAME, 30); + if(ConfigModel::GetInstance()->GetLanguage() == 0) + InitLabel(label1_, 133, 52, 200, 60, "label1", "GPS未准备", DEFAULT_VECTOR_FONT_FILENAME, 30); + else + InitLabel(label1_, 133, 52, 200, 60, "label1", "GPS Not Ready", DEFAULT_VECTOR_FONT_FILENAME, 30); + if(ConfigModel::GetInstance()->GetLanguage() == 0) + InitLabel(label2_, 33, 215, 400, 90, "label2", "GPS仍在定位,建议等待定位 完成后再开始训练", DEFAULT_VECTOR_FONT_FILENAME, 30); + else + InitLabel(label2_, 33, 215, 400, 90, "label2", "GPS Still Locating, Suggest Waiting for Positioning to Complete Before Starting Training", DEFAULT_VECTOR_FONT_FILENAME, 30); scrollView1_->Add(label1_); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_card/src/TraingCardPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_card/src/TraingCardPresenter.cpp index 49b809fbb..8e82f62e0 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_card/src/TraingCardPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/training_card/src/TraingCardPresenter.cpp @@ -183,11 +183,17 @@ bool TraingCardPresenter::OnDragEnd(UIView &view, const DragEvent &event) { bool gpsStatus = TraingModel::GetInstance()->GetGPSConnectState(); std::string gpsStatusStr; if (gpsStatus) { - gpsStatusStr = "GPS定位成功"; + if(ConfigModel::GetInstance()->GetLanguage() == 0) + gpsStatusStr = "GPS定位成功"; + else + gpsStatusStr = "GPS Success"; TrainingControlView::GetInstance()->GetGpsStatusLabel()->SetTextColor( Color::Green()); } else { - gpsStatusStr = "GPS未定位成功"; + if(ConfigModel::GetInstance()->GetLanguage() == 0) + gpsStatusStr = "GPS未定位成功"; + else + gpsStatusStr = "GPS not found"; TrainingControlView::GetInstance()->GetGpsStatusLabel()->SetTextColor( Color::Red()); }