diff --git a/bundle.json b/bundle.json
index 2f582dd2..5f561702 100644
--- a/bundle.json
+++ b/bundle.json
@@ -83,6 +83,7 @@
"//base/global/i18n/interfaces/js/kits:build_module",
"//base/global/i18n/interfaces/cj:build_module",
"//base/global/i18n/frameworks/intl:geocoding_depends",
+ "//base/global/i18n/ta:binary_files",
"//base/global/i18n/sa_profile:i18n_service_ability_profile",
"//base/global/i18n/services:i18n_service_ability"
],
diff --git a/frameworks/intl/BUILD.gn b/frameworks/intl/BUILD.gn
index 891049f7..b66b8a5b 100644
--- a/frameworks/intl/BUILD.gn
+++ b/frameworks/intl/BUILD.gn
@@ -32,12 +32,12 @@ config("preferred_language_config") {
]
}
ohos_shared_library("preferred_language") {
- stack_protector_ret = true
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
+ stack_protector_ret = true
public_configs = [ ":preferred_language_config" ]
include_dirs = [ "include" ]
@@ -76,12 +76,12 @@ config("intl_util_config") {
]
}
ohos_shared_library("intl_util") {
- stack_protector_ret = true
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
+ stack_protector_ret = true
public_configs = [ ":intl_util_config" ]
include_dirs = []
@@ -133,7 +133,6 @@ ohos_shared_library("intl_util") {
":CN_phonenumber_xml",
":GB_phonenumber_xml",
":bo_lang_xml",
- ":bo_region_xml",
":common_datetime_xml",
":common_phonenumber_xml",
":config_locales_xml",
@@ -148,14 +147,11 @@ ohos_shared_library("intl_util") {
":region_supported_locales_xml",
":root_timezone_xml",
":timezones_xml",
- ":tz_pixel_dat",
":ug_lang_xml",
- ":ug_region_xml",
":zh_Hans_lang_xml",
":zh_Hans_region_xml",
":zh_Hans_timezone_xml",
":zh_Hant_lang_xml",
- ":zh_Hant_region_xml",
":zh_datetime_xml",
]
use_exceptions = true
@@ -331,14 +327,6 @@ ohos_prebuilt_etc("timezones_xml") {
subsystem_name = "global"
}
-ohos_prebuilt_etc("tz_pixel_dat") {
- source =
- "//base/global/i18n/frameworks/intl/etc/timezone/tz_2023001-000360.dat"
- module_install_dir = "usr/ohos_timezone/"
- part_name = "i18n"
- subsystem_name = "global"
-}
-
ohos_prebuilt_etc("region_supported_locales_xml") {
source = "//base/global/i18n/frameworks/intl/etc/region/supported_regions.xml"
module_install_dir = "usr/ohos_locale_config/region/"
@@ -360,27 +348,6 @@ ohos_prebuilt_etc("en_Latn_region_xml") {
subsystem_name = "global"
}
-ohos_prebuilt_etc("zh_Hant_region_xml") {
- source = "//base/global/i18n/frameworks/intl/etc/region/zh-Hant.xml"
- module_install_dir = "usr/ohos_locale_config/region/"
- part_name = "i18n"
- subsystem_name = "global"
-}
-
-ohos_prebuilt_etc("bo_region_xml") {
- source = "//base/global/i18n/frameworks/intl/etc/region/bo.xml"
- module_install_dir = "usr/ohos_locale_config/region/"
- part_name = "i18n"
- subsystem_name = "global"
-}
-
-ohos_prebuilt_etc("ug_region_xml") {
- source = "//base/global/i18n/frameworks/intl/etc/region/ug.xml"
- module_install_dir = "usr/ohos_locale_config/region/"
- part_name = "i18n"
- subsystem_name = "global"
-}
-
ohos_prebuilt_etc("dialect_languages_xml") {
source = "//base/global/i18n/frameworks/intl/etc/dialect_languages.xml"
module_install_dir = "usr/ohos_locale_config/"
diff --git a/frameworks/intl/etc/i18n.para.dac b/frameworks/intl/etc/i18n.para.dac
index 3c25b11d..cccb9ef3 100644
--- a/frameworks/intl/etc/i18n.para.dac
+++ b/frameworks/intl/etc/i18n.para.dac
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Huawei Device Co., Ltd.
+# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
diff --git a/frameworks/intl/etc/region/bo.xml b/frameworks/intl/etc/region/bo.xml
deleted file mode 100644
index dc2003d2..00000000
--- a/frameworks/intl/etc/region/bo.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
- HK
- ཀྲུང་གོའི་ཞང་ཀང་།
-
-
- MO
- ཀྲུང་གོའི་ཨའོ་མོན།
-
-
- TW
- ཀྲུང་གོའི་ཐའེ་ཝན།
-
-
\ No newline at end of file
diff --git a/frameworks/intl/etc/region/supported_regions.xml b/frameworks/intl/etc/region/supported_regions.xml
index cda2d465..c261d4a1 100644
--- a/frameworks/intl/etc/region/supported_regions.xml
+++ b/frameworks/intl/etc/region/supported_regions.xml
@@ -15,7 +15,4 @@
- en-Latn-US
- zh-Hans
- - zh-Hant
- - bo
- - ug
\ No newline at end of file
diff --git a/frameworks/intl/etc/region/ug.xml b/frameworks/intl/etc/region/ug.xml
deleted file mode 100644
index 42420854..00000000
--- a/frameworks/intl/etc/region/ug.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
- HK
- جۇڭگو شياڭگاڭ
-
-
- MO
- جۇڭگو ئاۋمېن
-
-
- TW
- جۇڭگو تەيۋەن
-
-
\ No newline at end of file
diff --git a/frameworks/intl/etc/region/zh-Hant.xml b/frameworks/intl/etc/region/zh-Hant.xml
deleted file mode 100644
index c1b63006..00000000
--- a/frameworks/intl/etc/region/zh-Hant.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
- HK
- 中國香港
-
-
- MO
- 中國澳門
-
-
- TW
- 中國台灣
-
-
\ No newline at end of file
diff --git a/frameworks/intl/src/date_time_filter.cpp b/frameworks/intl/src/date_time_filter.cpp
index ccc0259a..189d4bb5 100644
--- a/frameworks/intl/src/date_time_filter.cpp
+++ b/frameworks/intl/src/date_time_filter.cpp
@@ -215,7 +215,6 @@ std::vector DateTimeFilter::FilterDate(icu::UnicodeString&
{
std::vector result;
size_t lengthMatches = matches.size();
- unsigned int arrayIndexLessValue = 1;
for (size_t i = 0; i < lengthMatches; i++) {
MatchedDateTimeInfo match = matches[i];
std::string matchRegex = match.GetRegex();
@@ -225,7 +224,7 @@ std::vector DateTimeFilter::FilterDate(icu::UnicodeString&
result.push_back(match);
continue;
}
- size_t hasNum = matches.size() - arrayIndexLessValue - i;
+ size_t hasNum = matches.size() - 1 - i;
std::vector sub;
if (hasNum > 1) {
// 1 and 3 indicate the relative positions of the intercepted matches.
diff --git a/frameworks/intl/src/holiday_manager.cpp b/frameworks/intl/src/holiday_manager.cpp
index dfeaff76..b7986aa4 100644
--- a/frameworks/intl/src/holiday_manager.cpp
+++ b/frameworks/intl/src/holiday_manager.cpp
@@ -52,7 +52,7 @@ HolidayManager::HolidayManager(const char* path)
char strDate[10];
size_t resCode = strftime(strDate, sizeof(strDate), "%Y%m%d", &tmObj);
if (resCode == 0) {
- HILOG_ERROR_I18N("Failed: strftime error:%{public}zu .", resCode);
+ HILOG_ERROR_I18N("Failed: strftime error:%{public}zu.", resCode);
return;
}
std::string startDate(strDate);
diff --git a/frameworks/intl/src/i18n_timezone.cpp b/frameworks/intl/src/i18n_timezone.cpp
index 231cd61e..d89a4aa1 100644
--- a/frameworks/intl/src/i18n_timezone.cpp
+++ b/frameworks/intl/src/i18n_timezone.cpp
@@ -744,9 +744,7 @@ __attribute__((no_sanitize("cfi"))) std::string I18nTimeZone::GetDisplayNameByTa
getReplacedTimezoneDisplayName(localeStr.c_str(), GetID().c_str(), recvArr);
}
result = recvArr;
-#ifndef SUPPORT_ASAN
dlclose(i18nUtilHandle);
-#endif
return result;
}
diff --git a/frameworks/intl/src/phone_number_format.cpp b/frameworks/intl/src/phone_number_format.cpp
index 2b40da4b..0f40a63b 100644
--- a/frameworks/intl/src/phone_number_format.cpp
+++ b/frameworks/intl/src/phone_number_format.cpp
@@ -241,6 +241,7 @@ void PhoneNumberFormat::OpenHandler()
HILOG_INFO_I18N("DynamicHandler init.");
std::lock_guard phoneLock(phoneMutex);
if (dynamicHandler == nullptr) {
+ HILOG_INFO_I18N("DynamicHandler lock init.");
#ifndef SUPPORT_ASAN
const char* geocodingSO = "libgeocoding.z.so";
#else
diff --git a/frameworks/intl/src/relative_time_format.cpp b/frameworks/intl/src/relative_time_format.cpp
index 10b61a60..e2f2af90 100644
--- a/frameworks/intl/src/relative_time_format.cpp
+++ b/frameworks/intl/src/relative_time_format.cpp
@@ -14,8 +14,8 @@
*/
#include "locale_config.h"
#include "ohos/init_data.h"
-#include "parameter.h"
#include "utils.h"
+#include "parameter.h"
#include "relative_time_format.h"
namespace OHOS {
diff --git a/frameworks/zone/BUILD.gn b/frameworks/zone/BUILD.gn
index 614402c0..0dc49451 100644
--- a/frameworks/zone/BUILD.gn
+++ b/frameworks/zone/BUILD.gn
@@ -21,12 +21,12 @@ config("zone_util_public_configs") {
}
ohos_shared_library("zone_util") {
- stack_protector_ret = true
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
+ stack_protector_ret = true
public_configs = [ ":zone_util_public_configs" ]
sources = [ "src/zone_util.cpp" ]
diff --git a/interfaces/js/kits/BUILD.gn b/interfaces/js/kits/BUILD.gn
index 957fbfcd..f276baac 100644
--- a/interfaces/js/kits/BUILD.gn
+++ b/interfaces/js/kits/BUILD.gn
@@ -22,12 +22,12 @@ group("build_module") {
}
ohos_shared_library("intl") {
- stack_protector_ret = true
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
+ stack_protector_ret = true
include_dirs = [
"//base/global/i18n/frameworks/intl/include",
@@ -36,7 +36,9 @@ ohos_shared_library("intl") {
sources = [ "src/intl_addon.cpp" ]
- deps = [ "//base/global/i18n/frameworks/intl:intl_util" ]
+ deps = [
+ "//base/global/i18n/frameworks/intl:intl_util",
+ ]
external_deps = [
"hilog:libhilog",
"icu:shared_icuuc",
@@ -49,12 +51,12 @@ ohos_shared_library("intl") {
}
ohos_shared_library("i18n") {
- stack_protector_ret = true
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
+ stack_protector_ret = true
include_dirs = [
"//base/global/i18n/frameworks/intl/include",
diff --git a/ta/BUILD.gn b/ta/BUILD.gn
new file mode 100644
index 00000000..0e183423
--- /dev/null
+++ b/ta/BUILD.gn
@@ -0,0 +1,28 @@
+# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build/ohos.gni")
+
+group("binary_files") {
+ deps = [
+ ":tz_pixel_dat"
+ ]
+}
+
+ohos_prebuilt_etc("tz_pixel_dat") {
+ source =
+ "//base/global/i18n/ta/timezone/tz_2023001-000360.dat"
+ module_install_dir = "usr/ohos_timezone/"
+ part_name = "i18n"
+ subsystem_name = "global"
+}
\ No newline at end of file
diff --git a/frameworks/intl/etc/timezone/tz_2023001-000360.dat b/ta/timezone/tz_2023001-000360.dat
similarity index 100%
rename from frameworks/intl/etc/timezone/tz_2023001-000360.dat
rename to ta/timezone/tz_2023001-000360.dat