From: luozheng <1732036298@qq.com>
Date: Mon, 6 May 2024 07:09:31 +0000 (+0800)
Subject: 修改蓝牙Slice以适配多国语言
X-Git-Tag: release_V1.2.70_20241020_135402~1113^2~24
X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=6ec3283f397181eea56de2b50f87ecc0e0e66082;p=mirrors%2FFD230.git
修改蓝牙Slice以适配多国语言
---
diff --git a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h
index 3c997a1fc..eb20dde57 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h
+++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h
@@ -2,7 +2,7 @@
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-04-25 11:49:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-04-25 15:14:34
+ * @LastEditTime: 2024-05-06 15:00:23
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h
*/
@@ -32,7 +32,8 @@ namespace OHOS
int16_t height;
int16_t fontSize; // åä½å¤§å°
int16_t lineHeigh; // è¡é«
- const char *text; // ææ¬
+ //const char *text; // ææ¬
+ uint16_t textId;
uint8_t lineBreakMode; // æè¡æ¨¡å¼ã
};
BluetoothServiceOptionsView();
diff --git a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/ClassicBlueToothView.h b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/ClassicBlueToothView.h
index 9cad993b9..9264fc9a7 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/ClassicBlueToothView.h
+++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/ClassicBlueToothView.h
@@ -1,3 +1,10 @@
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-04-25 11:51:04
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-05-06 14:20:02
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/ClassicBlueToothView.h
+ */
#ifndef CLASSIC_BLUETOOTH_VIEW_H
#define CLASSIC_BLUETOOTH_VIEW_H
@@ -28,7 +35,8 @@ namespace OHOS
int16_t height;
int16_t fontSize; // åä½å¤§å°
int16_t lineHeigh; // è¡é«
- const char *text; // ææ¬
+ //const char *text; // ææ¬
+ uint16_t textId;
uint8_t lineBreakMode; // æè¡æ¨¡å¼ã
};
ClassicBlueToothView();
diff --git a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp
index d8002210f..6f9beb82f 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp
+++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp
@@ -94,7 +94,8 @@ 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); // åä½è¡é«
- label->SetText(labelconfig.text); // å
容
+ //label->SetText(labelconfig.text); // å
容
+ label->SetTextId(labelconfig.textId);
label->SetLineBreakMode(labelconfig.lineBreakMode); // æè¡æ¨¡å¼ã
label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
return label;
@@ -110,7 +111,8 @@ namespace OHOS
.height = 40,
.fontSize = 30,
.lineHeigh = 35,
- .text = "èçæå¡é项",
+ //.text = "èçæå¡é项",
+ .textId = STR_BLUETOOTH_SERVICE_OPTIONS,
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
};
Title = SetBluetoothServiceOptionsViewLabel(labelconfig);
@@ -128,7 +130,8 @@ namespace OHOS
.height = 40,
.fontSize = 30,
.lineHeigh = 35,
- .text = "éè¯èç",
+ //.text = "éè¯èç",
+ .textId = STR_HFP,
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
};
HFP_Label = SetBluetoothServiceOptionsViewLabel(labelconfig);
@@ -138,7 +141,8 @@ namespace OHOS
return false;
}
labelconfig.top = 273;
- labelconfig.text = "åªä½èç";
+ //labelconfig.text = "åªä½èç";
+ labelconfig.textId = STR_A2DP;
A2DP_Label = SetBluetoothServiceOptionsViewLabel(labelconfig);
if (nullptr == A2DP_Label)
{
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 f4957a018..a6403bc5a 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp
+++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp
@@ -95,7 +95,8 @@ 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); // åä½è¡é«
- label->SetText(labelconfig.text); // å
容
+ //label->SetText(labelconfig.text); // å
容
+ label->SetTextId(labelconfig.textId);
label->SetLineBreakMode(labelconfig.lineBreakMode); // æè¡æ¨¡å¼ã
label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
return label;
@@ -111,7 +112,8 @@ namespace OHOS
.height = 40,
.fontSize = 30,
.lineHeigh = 35,
- .text = "èç",
+ //.text = "èç",
+ .textId = STR_BLUETOOTH,
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
};
Title = SetClassicBlueToothViewLabel(labelconfig);
@@ -129,7 +131,8 @@ namespace OHOS
.height = 40,
.fontSize = 30,
.lineHeigh = 35,
- .text = "èçè³æº",
+ //.text = "èçè³æº",
+ .textId = STR_BLUETOOTH_HEADPHONES,
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
};
BlueToothEarPhoneLabel = SetClassicBlueToothViewLabel(labelconfig);
@@ -140,7 +143,8 @@ namespace OHOS
}
/* -------------------------------------------------------------------------- */
labelconfig.top = 273;
- labelconfig.text = "ä¼ ç»èç";
+ //labelconfig.text = "ä¼ ç»èç";
+ labelconfig.textId = STR_TRADITIONAL_BLUETOOTH;
TradionalBlueToothLabel = SetClassicBlueToothViewLabel(labelconfig);
if (nullptr == TradionalBlueToothLabel)
{
@@ -149,7 +153,8 @@ namespace OHOS
}
/* -------------------------------------------------------------------------- */
labelconfig.top = 393;
- labelconfig.text = "èçæå¡é项";
+ //labelconfig.text = "èçæå¡é项";
+ labelconfig.textId = STR_BLUETOOTH_SERVICE_OPTIONS;
BluetoothServiceOptionsLabel = SetClassicBlueToothViewLabel(labelconfig);
if (nullptr == BluetoothServiceOptionsLabel)
{
@@ -164,7 +169,8 @@ namespace OHOS
.height = 180,
.fontSize = 20,
.lineHeigh = 30,
- .text = "注ï¼å¼å¯å10åéæ²¡è¿æ¥æåä¼èªå¨å
³éï¼å ä¸ºä¼ ç»èçé¿æ¶é´æå¼ä¼å¢å çµèï¼å»ºè®®å¨æéè¦çæ¶å使ç¨\n\nï¼è¯¥åè½ä¸»è¦ç¨äºçµè¯æ¨æ/éç¥ãé³ä¹æ§å¶/ä¼ è¾çï¼",
+ //.text = "注ï¼å¼å¯å10åéæ²¡è¿æ¥æåä¼èªå¨å
³éï¼å ä¸ºä¼ ç»èçé¿æ¶é´æå¼ä¼å¢å çµèï¼å»ºè®®å¨æéè¦çæ¶å使ç¨\n\nï¼è¯¥åè½ä¸»è¦ç¨äºçµè¯æ¨æ/éç¥ãé³ä¹æ§å¶/ä¼ è¾çï¼",
+ .textId = STR_AUTO_OFF_BLUETOOTH_NOTE,
.lineBreakMode = UILabel::LINE_BREAK_WRAP,
};
AttentionLabel = SetClassicBlueToothViewLabel(labelconfig);
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt
index 83559eea9..b1b9505f5 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt
@@ -259,4 +259,10 @@ STR_VOLTE_CALL$VoLTE call
STR_MOBILE_DATA_OPTION$Mobile data option
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\n\n(this function is mainly used for phone calls/notificationsãmusic control/transmission, etc.)
+STR_BLUETOOTH_SERVICE_OPTIONS$Bluetooth Service Options
+STR_HFP$HFP
+STR_A2DP$A2DP
STR_LANGUAGE$Language
\ No newline at end of file
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt
index 011a1ef53..839acad9e 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt
@@ -259,4 +259,10 @@ STR_VOLTE_CALL$VoLTE éè¯
STR_MOBILE_DATA_OPTION$ç§»å¨æ°æ®é项
STR_SYSTEM_UPDATE$ç³»ç»æ´æ°
STR_ONLINE_MUSIC$å¨çº¿é³ä¹
+STR_BLUETOOTH_HEADPHONES$èçè³æº
+STR_TRADITIONAL_BLUETOOTH$ä¼ ç»èç
+STR_AUTO_OFF_BLUETOOTH_NOTE$注ï¼å¼å¯å10åéæ²¡è¿æ¥æåä¼èªå¨å
³éï¼å ä¸ºä¼ ç»èçé¿æ¶é´æå¼ä¼å¢å çµèï¼å»ºè®®å¨æéè¦çæ¶å使ç¨\n\nï¼è¯¥åè½ä¸»è¦ç¨äºçµè¯æ¨æ/éç¥ãé³ä¹æ§å¶/ä¼ è¾çï¼
+STR_BLUETOOTH_SERVICE_OPTIONS$èçæå¡é项
+STR_HFP$éè¯èç
+STR_A2DP$åªä½èç
STR_LANGUAGE$è¯è¨
\ No newline at end of file
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml
index 1188d9244..02a50b4a4 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml
@@ -260,5 +260,11 @@
+
+
+
+
+
+
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml
index 6e1440e93..8a29365ff 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml
@@ -260,5 +260,11 @@
+
+
+
+
+
+
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang
index f7dcfdc56..283b2fa56 100644
Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang and b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang differ
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang
index d508778c6..fc7289d6a 100644
Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang and b/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang differ
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h
index ce9b23661..8eac6e1c1 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h
@@ -274,8 +274,14 @@ enum UIResourceTextId : uint16_t {
STR_MOBILE_DATA_OPTION = 261,
STR_SYSTEM_UPDATE = 262,
STR_ONLINE_MUSIC = 263,
- STR_LANGUAGE = 264,
- STR_MAX_ID = 265,
+ STR_BLUETOOTH_HEADPHONES = 264,
+ STR_TRADITIONAL_BLUETOOTH = 265,
+ STR_AUTO_OFF_BLUETOOTH_NOTE = 266,
+ STR_BLUETOOTH_SERVICE_OPTIONS = 267,
+ STR_HFP = 268,
+ STR_A2DP = 269,
+ STR_LANGUAGE = 270,
+ STR_MAX_ID = 271,
}; // UIResourceTextId
enum FontLanguageId : uint8_t {
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang
index 7cae968e2..1c3af03f2 100644
Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang and b/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang differ
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 f7dcfdc56..283b2fa56 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/ja.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.lang
index d508778c6..fc7289d6a 100644
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.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 ce9b23661..8eac6e1c1 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
@@ -274,8 +274,14 @@ enum UIResourceTextId : uint16_t {
STR_MOBILE_DATA_OPTION = 261,
STR_SYSTEM_UPDATE = 262,
STR_ONLINE_MUSIC = 263,
- STR_LANGUAGE = 264,
- STR_MAX_ID = 265,
+ STR_BLUETOOTH_HEADPHONES = 264,
+ STR_TRADITIONAL_BLUETOOTH = 265,
+ STR_AUTO_OFF_BLUETOOTH_NOTE = 266,
+ STR_BLUETOOTH_SERVICE_OPTIONS = 267,
+ STR_HFP = 268,
+ STR_A2DP = 269,
+ STR_LANGUAGE = 270,
+ STR_MAX_ID = 271,
}; // 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 7cae968e2..1c3af03f2 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