代码一致性

Signed-off-by: zhangdd_ewan <zhangdongdong50@huawei.com>
This commit is contained in:
zhangdd_ewan 2024-06-13 17:41:44 +08:00
parent d767287d54
commit c993f81cb6
16 changed files with 42 additions and 133 deletions

View File

@ -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"
],

View File

@ -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/"

View File

@ -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

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 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.
-->
<regions>
<region>
<id>HK</id>
<display_name>ཀྲུང་གོའི་ཞང་ཀང་།</display_name>
</region>
<region>
<id>MO</id>
<display_name>ཀྲུང་གོའི་ཨའོ་མོན།</display_name>
</region>
<region>
<id>TW</id>
<display_name>ཀྲུང་གོའི་ཐའེ་ཝན།</display_name>
</region>
</regions>

View File

@ -15,7 +15,4 @@
<supported_regions>
<item>en-Latn-US</item>
<item>zh-Hans</item>
<item>zh-Hant</item>
<item>bo</item>
<item>ug</item>
</supported_regions>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 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.
-->
<regions>
<region>
<id>HK</id>
<display_name>جۇڭگو شياڭگاڭ</display_name>
</region>
<region>
<id>MO</id>
<display_name>جۇڭگو ئاۋمېن</display_name>
</region>
<region>
<id>TW</id>
<display_name>جۇڭگو تەيۋەن</display_name>
</region>
</regions>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 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.
-->
<regions>
<region>
<id>HK</id>
<display_name>中國香港</display_name>
</region>
<region>
<id>MO</id>
<display_name>中國澳門</display_name>
</region>
<region>
<id>TW</id>
<display_name>中國台灣</display_name>
</region>
</regions>

View File

@ -215,7 +215,6 @@ std::vector<MatchedDateTimeInfo> DateTimeFilter::FilterDate(icu::UnicodeString&
{
std::vector<MatchedDateTimeInfo> 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<MatchedDateTimeInfo> 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<MatchedDateTimeInfo> sub;
if (hasNum > 1) {
// 1 and 3 indicate the relative positions of the intercepted matches.

View File

@ -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);

View File

@ -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;
}

View File

@ -241,6 +241,7 @@ void PhoneNumberFormat::OpenHandler()
HILOG_INFO_I18N("DynamicHandler init.");
std::lock_guard<std::mutex> phoneLock(phoneMutex);
if (dynamicHandler == nullptr) {
HILOG_INFO_I18N("DynamicHandler lock init.");
#ifndef SUPPORT_ASAN
const char* geocodingSO = "libgeocoding.z.so";
#else

View File

@ -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 {

View File

@ -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" ]

View File

@ -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",

28
ta/BUILD.gn Normal file
View File

@ -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"
}

View File

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB