电话中UI增加多国语言
authorhcj <1224667075@qq.com>
Mon, 26 Aug 2024 06:37:25 +0000 (14:37 +0800)
committerhcj <1224667075@qq.com>
Mon, 26 Aug 2024 06:37:25 +0000 (14:37 +0800)
18 files changed:
code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h
code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallerDisplayView.h
code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h
code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingView.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang
tools/language_tool/Language_xml/input_list_en.txt
tools/language_tool/Language_xml/input_list_zh.txt
tools/language_tool/Language_xml/language.xlsx
tools/language_tool/Language_xml/language_en.xml
tools/language_tool/Language_xml/language_zh.xml
tools/language_tool/font/en.lang
tools/language_tool/font/ui_resource_string.h
tools/language_tool/font/zh.lang

index 02cddf1..bdb6d2d 100644 (file)
@@ -547,12 +547,15 @@ enum UIResourceTextId : uint16_t {
     STR_SCHEDULE_TIME = 534,\r
     STR_SCHEDULE_NOTES = 535,\r
     STR_SCHEDULE_DELETE_PROMPT = 536,\r
-    STR_MAX_ID = 537,\r
+    STR_HANG_UP_OR_ANSWER = 537,\r
+    STR_WATCH_CALL = 538,\r
+    STR_PHONE_CALL = 539,\r
+    STR_MAX_ID = 540,\r
 }; // UIResourceTextId\r
 
 enum FontLanguageId : uint8_t {
-    LANGUAGE_ID_ZH,\r
     LANGUAGE_ID_EN,\r
+    LANGUAGE_ID_ZH,\r
     LANGUAGE_ID_MAX\r
 }; // UITextLanguageTextId\r
 }\r
index bf6af48..957ddd0 100644 (file)
@@ -35,11 +35,11 @@ private:
     UIImageView *imageDissgree{nullptr};
     UIImageView *imageperson{nullptr};
     
-    UILabel *callerDisplay{nullptr};
-    UILabel *currentTimes{nullptr};
+    UILabelExt *callerDisplay{nullptr};
+    UILabelExt *currentTimes{nullptr};
 
-    UILabel *label_call_source{nullptr};
-    UILabel *label_call_hint{nullptr};
+    UILabelExt *label_call_source{nullptr};
+    UILabelExt *label_call_hint{nullptr};
 };
 }
 
index 9f83efe..378b519 100644 (file)
@@ -18,6 +18,7 @@
 #include "ChangeSliceListener.h"
 #include "components/ui_label_button.h"
 
+
 namespace OHOS {
 class CallingView {
 public:
@@ -53,7 +54,7 @@ private:
 
     UIImageView *imageperson{nullptr};
     UILabel *callerDisplay{nullptr};
-    UILabel *currentTimes{nullptr};
+    UILabelExt *currentTimes{nullptr};
     UILabel *callDuration{nullptr};
 
     UIViewGroup *dial_group{nullptr};
index 4983723..13f8f23 100644 (file)
@@ -8,6 +8,7 @@
 #include "MainCallingPresenter.h"
 #include "UiConfig.h"
 #include "phoneaddressmodel.h"
+#include "ui_resource_string.h"
 
 namespace OHOS {
 static constexpr uint16 MATH_ZERO = 0;
@@ -149,7 +150,7 @@ void CallerDisplayView::updataCallingname(void)
 
 bool CallerDisplayView::InitUILabelDisplay()
 {
-    callerDisplay = new UILabel();
+    callerDisplay = new UILabelExt();
     if (callerDisplay == nullptr) {
         return false;
     }
@@ -176,17 +177,19 @@ bool CallerDisplayView::InitUILabelDisplay()
     group->Add(callerDisplay);
 
     if (label_call_hint == nullptr) {
-        label_call_hint = new UILabel();
+        label_call_hint = new UILabelExt();
     }
 
-    label_call_hint->SetPosition(163, 353);         // widget's left position and top position
-    label_call_hint->Resize(140, 35);          // widget's width and height
+    label_call_hint->SetPosition(133, 353);         // widget's left position and top position
+    label_call_hint->Resize(200, 35);          // widget's width and height
     label_call_hint->SetViewId("label3");// Set style
     label_call_hint->SetStyle(STYLE_TEXT_FONT, 30);
 
     // Set additional property
     label_call_hint->SetText("挂断/接听");
-    label_call_hint->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS);
+    label_call_hint->SetTextId(STR_HANG_UP_OR_ANSWER);
+    
+    label_call_hint->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
     label_call_hint->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff));
     label_call_hint->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
     label_call_hint->SetRollSpeed(0);
@@ -195,7 +198,7 @@ bool CallerDisplayView::InitUILabelDisplay()
 
 
     if (label_call_source == nullptr) {
-        label_call_source = new UILabel();
+        label_call_source = new UILabelExt();
     }
     label_call_source->SetPosition(133, 34);         // widget's left position and top position
     label_call_source->Resize(200, 60);          // widget's width and height
@@ -203,10 +206,17 @@ bool CallerDisplayView::InitUILabelDisplay()
     label_call_source->SetStyle(STYLE_TEXT_FONT, 30);
 
     // Set additional property
-    if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
-    label_call_source->SetText("手表来电");
+    if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) 
+    {   
+        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);
+    }
+   
     
     label_call_source->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
     label_call_source->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff));
index 55d6cb1..29dbd0a 100644 (file)
@@ -14,6 +14,7 @@
 #include "custom_utils.h"
 #include "phoneaddressmodel.h"
 #include "bletest.h"
+#include "ui_resource_string.h"
 
 namespace OHOS {
 static constexpr uint16 MATH_ZERO = 0;
@@ -278,15 +279,15 @@ bool CallingView::InitUILabelDisplay()
     // group->Add(callDuration);
 
 
-    currentTimes = new UILabel();
+    currentTimes = new UILabelExt();
     if (currentTimes == nullptr) {
         return false;
     }
-    currentTimes->SetPosition(194, 38,
-         79, 35);
+    currentTimes->SetPosition(184, 38,
+         89, 35);
     currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
     currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER);
-
+    currentTimes->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
     currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str());
    
   
@@ -472,7 +473,7 @@ UIViewGroup *CallingView::CreateUIViewGroup(uint8_t type)
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitUILabelDisplay error");
         return nullptr;
     }
-    currentTimes->SetText("拨号中...");    /* code */
+    currentTimes->SetTextId(STR_CALLING);    /* code */
 
     if(!Initshowdial())
     {
index bac2615..d759215 100644 (file)
@@ -30,6 +30,10 @@ MainCallingView::~MainCallingView()
     delete screenView;
     screenView = nullptr;
 
+    delete waitingView;
+    waitingView = nullptr;
+
+
     g_pMainView = nullptr;
 }
 
index 87db043..22eedc5 100644 (file)
@@ -38,6 +38,21 @@ WaitingHintsView::WaitingHintsView()
 WaitingHintsView::~WaitingHintsView()
 {
     g_pMainView = nullptr;
+
+    group->RemoveAll();
+    delete imageDissgree;
+    imageDissgree = nullptr;
+
+    delete callerDisplay;
+    callerDisplay = nullptr;
+
+    delete newcallHints;
+    newcallHints = nullptr;
+
+
+    delete group;
+    group = nullptr;
+
 }
 
 UIViewGroup *WaitingHintsView::CreateUIViewGroup()
index fd9a836..8779149 100644 (file)
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
index 02cddf1..bdb6d2d 100644 (file)
@@ -547,12 +547,15 @@ enum UIResourceTextId : uint16_t {
     STR_SCHEDULE_TIME = 534,\r
     STR_SCHEDULE_NOTES = 535,\r
     STR_SCHEDULE_DELETE_PROMPT = 536,\r
-    STR_MAX_ID = 537,\r
+    STR_HANG_UP_OR_ANSWER = 537,\r
+    STR_WATCH_CALL = 538,\r
+    STR_PHONE_CALL = 539,\r
+    STR_MAX_ID = 540,\r
 }; // UIResourceTextId\r
 
 enum FontLanguageId : uint8_t {
-    LANGUAGE_ID_ZH,\r
     LANGUAGE_ID_EN,\r
+    LANGUAGE_ID_ZH,\r
     LANGUAGE_ID_MAX\r
 }; // UITextLanguageTextId\r
 }\r
index 636402e..3b168b6 100644 (file)
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
index ff2f091..a21feaa 100644 (file)
@@ -422,7 +422,7 @@ STR_DIAL_MODE$Dial Mode
 STR_DIAL_VIA_WATCH_SIM$Dial via Watch SIM\r
 STR_DIAL_VIA_PHONE$Dial via Phone\r
 STR_KUMI_TECHNOLOGY$KUMI Technology\r
-STR_CALLING$Calling\r
+STR_CALLING$Calling...\r
 STR_NOT_PAIRED$Not Paired\r
 STR_PAIRED$Paired\r
 STR_UNPAIR$Unpair\r
@@ -534,4 +534,7 @@ STR_TMCHBR$The maximum count has been reached
 STR_SCHEDULE_TOPIC$Topic:\r
 STR_SCHEDULE_TIME$Time:\r
 STR_SCHEDULE_NOTES$Notes:\r
-STR_SCHEDULE_DELETE_PROMPT$Delete this schedule
\ No newline at end of file
+STR_SCHEDULE_DELETE_PROMPT$Delete this schedule\r
+STR_HANG_UP_OR_ANSWER$HangUp/Answer\r
+STR_WATCH_CALL$Watch Call\r
+STR_PHONE_CALL$Phone Call
\ No newline at end of file
index 5b38544..91cfcf5 100644 (file)
@@ -422,7 +422,7 @@ STR_DIAL_MODE$拨号方式
 STR_DIAL_VIA_WATCH_SIM$通过手表SIM卡拨号\r
 STR_DIAL_VIA_PHONE$通过手机拨号\r
 STR_KUMI_TECHNOLOGY$库密科技\r
-STR_CALLING$拨号中\r
+STR_CALLING$拨号中...\r
 STR_NOT_PAIRED$未配对\r
 STR_PAIRED$已配对\r
 STR_UNPAIR$取消配对\r
@@ -534,4 +534,7 @@ STR_TMCHBR$当前已达到了最高计数
 STR_SCHEDULE_TOPIC$主题:\r
 STR_SCHEDULE_TIME$时间:\r
 STR_SCHEDULE_NOTES$备注:\r
-STR_SCHEDULE_DELETE_PROMPT$是否确认删除该日程
\ No newline at end of file
+STR_SCHEDULE_DELETE_PROMPT$是否确认删除该日程\r
+STR_HANG_UP_OR_ANSWER$挂断/接听\r
+STR_WATCH_CALL$手表来电\r
+STR_PHONE_CALL$手机来电
\ No newline at end of file
index fff3495..6614b2b 100644 (file)
Binary files a/tools/language_tool/Language_xml/language.xlsx and b/tools/language_tool/Language_xml/language.xlsx differ
index 5cec801..adfc79e 100644 (file)
        <lanstr id="STR_DIAL_VIA_WATCH_SIM" value="Dial via Watch SIM"/>
        <lanstr id="STR_DIAL_VIA_PHONE" value="Dial via Phone"/>
        <lanstr id="STR_KUMI_TECHNOLOGY" value="KUMI Technology"/>
-       <lanstr id="STR_CALLING" value="Calling"/>
+       <lanstr id="STR_CALLING" value="Calling..."/>
        <lanstr id="STR_NOT_PAIRED" value="Not Paired"/>
        <lanstr id="STR_PAIRED" value="Paired"/>
        <lanstr id="STR_UNPAIR" value="Unpair"/>
        <lanstr id="STR_SCHEDULE_TIME" value="Time:"/>
        <lanstr id="STR_SCHEDULE_NOTES" value="Notes:"/>
        <lanstr id="STR_SCHEDULE_DELETE_PROMPT" value="Delete this schedule"/>
+       <lanstr id="STR_HANG_UP_OR_ANSWER" value="HangUp/Answer"/>
+       <lanstr id="STR_WATCH_CALL" value="Watch Call"/>
+       <lanstr id="STR_PHONE_CALL" value="Phone Call"/>
 </language>
index aff2b2a..4271a09 100644 (file)
        <lanstr id="STR_DIAL_VIA_WATCH_SIM" value="通过手表SIM卡拨号"/>
        <lanstr id="STR_DIAL_VIA_PHONE" value="通过手机拨号"/>
        <lanstr id="STR_KUMI_TECHNOLOGY" value="库密科技"/>
-       <lanstr id="STR_CALLING" value="拨号中"/>
+       <lanstr id="STR_CALLING" value="拨号中..."/>
        <lanstr id="STR_NOT_PAIRED" value="未配对"/>
        <lanstr id="STR_PAIRED" value="已配对"/>
        <lanstr id="STR_UNPAIR" value="取消配对"/>
        <lanstr id="STR_SCHEDULE_TIME" value="时间:"/>
        <lanstr id="STR_SCHEDULE_NOTES" value="备注:"/>
        <lanstr id="STR_SCHEDULE_DELETE_PROMPT" value="是否确认删除该日程"/>
+       <lanstr id="STR_HANG_UP_OR_ANSWER" value="挂断/接听"/>
+       <lanstr id="STR_WATCH_CALL" value="手表来电"/>
+       <lanstr id="STR_PHONE_CALL" value="手机来电"/>
 </language>
index fd9a836..8779149 100644 (file)
Binary files a/tools/language_tool/font/en.lang and b/tools/language_tool/font/en.lang differ
index 02cddf1..bdb6d2d 100644 (file)
@@ -547,12 +547,15 @@ enum UIResourceTextId : uint16_t {
     STR_SCHEDULE_TIME = 534,\r
     STR_SCHEDULE_NOTES = 535,\r
     STR_SCHEDULE_DELETE_PROMPT = 536,\r
-    STR_MAX_ID = 537,\r
+    STR_HANG_UP_OR_ANSWER = 537,\r
+    STR_WATCH_CALL = 538,\r
+    STR_PHONE_CALL = 539,\r
+    STR_MAX_ID = 540,\r
 }; // UIResourceTextId\r
 
 enum FontLanguageId : uint8_t {
-    LANGUAGE_ID_ZH,\r
     LANGUAGE_ID_EN,\r
+    LANGUAGE_ID_ZH,\r
     LANGUAGE_ID_MAX\r
 }; // UITextLanguageTextId\r
 }\r
index 636402e..3b168b6 100644 (file)
Binary files a/tools/language_tool/font/zh.lang and b/tools/language_tool/font/zh.lang differ