From efe14bf484b5560d2ed42a3cb47951a719031426 Mon Sep 17 00:00:00 2001 From: the-minions-of-cplu Date: Tue, 12 Apr 2022 15:00:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9i18n=E9=83=A8=E4=BB=B6?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: the-minions-of-cplu --- README.md | 2 +- README_zh.md | 2 +- bundle.json | 30 +++++++++--------- frameworks/intl/BUILD.gn | 43 ++++++++++++-------------- frameworks/intl/include/character.h | 4 +-- frameworks/intl/include/collator.h | 4 +-- frameworks/intl/include/index_util.h | 4 +-- frameworks/intl/include/plural_rules.h | 4 +-- frameworks/intl/test/BUILD.gn | 6 ++-- frameworks/zone/BUILD.gn | 4 +-- frameworks/zone/test/BUILD.gn | 6 ++-- interfaces/js/kits/BUILD.gn | 18 +++++------ 12 files changed, 62 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index ddfc97fd..c79d6340 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The directory structure for the i18n module is as follows: ``` /base/global/ -├── i18n_standard # Code repository for the i18n framework +├── i18n # Code repository for the i18n framework │ ├── frameworks # Core code of the i18n framework │ ├── interfaces # APIs │ │ ├── js # JavaScript APIs diff --git a/README_zh.md b/README_zh.md index 068325fd..f86c4530 100644 --- a/README_zh.md +++ b/README_zh.md @@ -16,7 +16,7 @@ ``` /base/global/ -├── i18n_standard # 国际化框架代码仓 +├── i18n # 国际化框架代码仓 │ ├── frameworks # 国际化框架核心代码 │ ├── interfaces # 国际化框架接口 │ │ ├── js # 国际化框架JavaScript接口 diff --git a/bundle.json b/bundle.json index 06292274..a956f7d6 100644 --- a/bundle.json +++ b/bundle.json @@ -1,10 +1,10 @@ { - "name": "@ohos/global_i18n_standard", + "name": "@ohos/global_i18n", "version": "1.0.0", "description": "Provides internationalization APIS for implementing functions such date and time formatting.", "homePage": "https://gitee.com/openharmony/", "license": "Apache V2", - "repository": "https://gitee.com/openharmony/global_i18n_standard", + "repository": "https://gitee.com/openharmony/global_i18n", "domain": "os", "language": "", "publishAs": "code-segment", @@ -32,10 +32,10 @@ } ], "segment": { - "destPath": "base/global/i18n_standard" + "destPath": "base/global/i18n" }, "component": { - "name": "i18n_standard", + "name": "i18n", "subsystem": "global", "syscap": [ "SystemCapability.Global.I18n" @@ -66,43 +66,43 @@ }, "build": { "sub_component": [ - "//base/global/i18n_standard/frameworks/zone:zone_util", - "//base/global/i18n_standard/frameworks/intl:build_module", - "//base/global/i18n_standard/interfaces/js/kits:build_module" + "//base/global/i18n/frameworks/zone:zone_util", + "//base/global/i18n/frameworks/intl:build_module", + "//base/global/i18n/interfaces/js/kits:build_module" ], "inner_kits": [ { - "name": "//base/global/i18n_standard/frameworks/zone:zone_util", + "name": "//base/global/i18n/frameworks/zone:zone_util", "header": { "header_files": [ "zone_util.h" ], - "header_base": "//base/global/i18n_standard/interfaces/native/innerkits/zone/include" + "header_base": "//base/global/i18n/interfaces/native/innerkits/zone/include" } }, { - "name": "//base/global/i18n_standard/frameworks/intl:intl_util", + "name": "//base/global/i18n/frameworks/intl:intl_util", "header": { "header_files": [ "locale_config.h", "locale_info.h" ], - "header_base": "//base/global/i18n_standard/frameworks/intl/include" + "header_base": "//base/global/i18n/frameworks/intl/include" } }, { - "name": "//base/global/i18n_standard/frameworks/intl:preferred_language", + "name": "//base/global/i18n/frameworks/intl:preferred_language", "header": { "header_files": [ "preferred_language.h" ], - "header_base": "//base/global/i18n_standard/interfaces/native/innerkits/preferred_language/include" + "header_base": "//base/global/i18n/interfaces/native/innerkits/preferred_language/include" } } ], "test": [ - "//base/global/i18n_standard/frameworks/intl/test:intl_test", - "//base/global/i18n_standard/frameworks/zone/test:zone_util_test" + "//base/global/i18n/frameworks/intl/test:intl_test", + "//base/global/i18n/frameworks/zone/test:zone_util_test" ] } } diff --git a/frameworks/intl/BUILD.gn b/frameworks/intl/BUILD.gn index e748b0d2..5ec70e5c 100644 --- a/frameworks/intl/BUILD.gn +++ b/frameworks/intl/BUILD.gn @@ -21,7 +21,9 @@ group("build_module") { } config("preferred_language_config") { - include_dirs = [ "//base/global/i18n_standard/interfaces/native/innerkits/preferred_language/include" ] + include_dirs = [ + "//base/global/i18n/interfaces/native/innerkits/preferred_language/include", + ] } ohos_shared_library("preferred_language") { public_configs = [ ":preferred_language_config" ] @@ -31,13 +33,13 @@ ohos_shared_library("preferred_language") { "-Wall", "-fPIC", ] - deps = [ "//base/global/i18n_standard/frameworks/intl:intl_util" ] + deps = [ "//base/global/i18n/frameworks/intl:intl_util" ] external_deps = [ "hiviewdfx_hilog_native:libhilog", "startup_l2:syspara", ] subsystem_name = "global" - part_name = "i18n_standard" + part_name = "i18n" } config("intl_util_config") { @@ -46,8 +48,8 @@ config("intl_util_config") { "//third_party/icu/icu4c/source/common", "//third_party/icu/icu4c/source/i18n", "//third_party/icu/icu4c/source/common/unicode", - "//base/global/i18n_standard/frameworks/intl/include", - "//base/global/i18n_standard/interfaces/native/innerkits/i18n/include", + "//base/global/i18n/frameworks/intl/include", + "//base/global/i18n/interfaces/native/innerkits/i18n/include", ] } ohos_shared_library("intl_util") { @@ -106,51 +108,46 @@ ohos_shared_library("intl_util") { cflags_cc += [ "-DTEL_CORE_SERVICE_EXISTS" ] } subsystem_name = "global" - part_name = "i18n_standard" + part_name = "i18n" } ohos_prebuilt_etc("language_config.para") { - source = - "//base/global/i18n_standard/frameworks/intl/etc/language_config.para" - part_name = "i18n_standard" + source = "//base/global/i18n/frameworks/intl/etc/language_config.para" + part_name = "i18n" module_install_dir = "etc/param" } ohos_prebuilt_etc("config_locales_xml") { - source = - "//base/global/i18n_standard/frameworks/intl/etc/supported_locales.xml" + source = "//base/global/i18n/frameworks/intl/etc/supported_locales.xml" module_install_dir = "usr/ohos_locale_config/" - part_name = "i18n_standard" + part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("config_regions_xml") { - source = - "//base/global/i18n_standard/frameworks/intl/etc/supported_regions.xml" + source = "//base/global/i18n/frameworks/intl/etc/supported_regions.xml" module_install_dir = "usr/ohos_locale_config/" - part_name = "i18n_standard" + part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("white_languages_xml") { - source = "//base/global/i18n_standard/frameworks/intl/etc/white_languages.xml" + source = "//base/global/i18n/frameworks/intl/etc/white_languages.xml" module_install_dir = "usr/ohos_locale_config/" - part_name = "i18n_standard" + part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("forbidden_languages_xml") { - source = - "//base/global/i18n_standard/frameworks/intl/etc/forbidden_languages.xml" + source = "//base/global/i18n/frameworks/intl/etc/forbidden_languages.xml" module_install_dir = "usr/ohos_locale_config/" - part_name = "i18n_standard" + part_name = "i18n" subsystem_name = "global" } ohos_prebuilt_etc("forbidden_regions_xml") { - source = - "//base/global/i18n_standard/frameworks/intl/etc/forbidden_regions.xml" + source = "//base/global/i18n/frameworks/intl/etc/forbidden_regions.xml" module_install_dir = "usr/ohos_locale_config/" - part_name = "i18n_standard" + part_name = "i18n" subsystem_name = "global" } diff --git a/frameworks/intl/include/character.h b/frameworks/intl/include/character.h index c2e2bfaa..dddd0465 100644 --- a/frameworks/intl/include/character.h +++ b/frameworks/intl/include/character.h @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef GLOBAL_I18N_STANDARD_CHARACTER_H -#define GLOBAL_I18N_STANDARD_CHARACTER_H +#ifndef GLOBAL_I18N_CHARACTER_H +#define GLOBAL_I18N_CHARACTER_H #include #include #include "unicode/uchar.h" diff --git a/frameworks/intl/include/collator.h b/frameworks/intl/include/collator.h index 2b65a957..e1a0eced 100644 --- a/frameworks/intl/include/collator.h +++ b/frameworks/intl/include/collator.h @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef GLOBAL_I18N_STANDARD_COLLATOR_H -#define GLOBAL_I18N_STANDARD_COLLATOR_H +#ifndef GLOBAL_i18n_COLLATOR_H +#define GLOBAL_i18n_COLLATOR_H #include #include diff --git a/frameworks/intl/include/index_util.h b/frameworks/intl/include/index_util.h index 41a6cef2..db2a4763 100644 --- a/frameworks/intl/include/index_util.h +++ b/frameworks/intl/include/index_util.h @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef GLOBAL_I18N_STANDARD_INDEX_UTIL_H -#define GLOBAL_I18N_STANDARD_INDEX_UTIL_H +#ifndef GLOBAL_I18N_INDEX_UTIL_H +#define GLOBAL_I18N_INDEX_UTIL_H #include #include diff --git a/frameworks/intl/include/plural_rules.h b/frameworks/intl/include/plural_rules.h index 36216480..612a60ae 100644 --- a/frameworks/intl/include/plural_rules.h +++ b/frameworks/intl/include/plural_rules.h @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef GLOBAL_I18N_STANDARD_PLURAL_RULES_H -#define GLOBAL_I18N_STANDARD_PLURAL_RULES_H +#ifndef GLOBAL_I18N_PLURAL_RULES_H +#define GLOBAL_I18N_PLURAL_RULES_H #include #include diff --git a/frameworks/intl/test/BUILD.gn b/frameworks/intl/test/BUILD.gn index 9ccd79f2..678fc625 100644 --- a/frameworks/intl/test/BUILD.gn +++ b/frameworks/intl/test/BUILD.gn @@ -13,7 +13,7 @@ import("//build/test.gni") -module_output_path = "i18n_standard/intl_test" +module_output_path = "i18n/intl_test" ohos_unittest("intl_test") { module_out_path = module_output_path @@ -23,12 +23,12 @@ ohos_unittest("intl_test") { "unittest/locale_config_test.cpp", ] include_dirs = [ - "//base/global/i18n_standard/frameworks/intl/include", + "//base/global/i18n/frameworks/intl/include", "//third_party/icu/icu4c/source/common", "//third_party/icu/icu4c/source/i18n", ] deps = [ - "//base/global/i18n_standard/frameworks/intl:intl_util", + "//base/global/i18n/frameworks/intl:intl_util", "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", "//third_party/googletest:gtest_main", "//third_party/icu/icu4c:shared_icui18n", diff --git a/frameworks/zone/BUILD.gn b/frameworks/zone/BUILD.gn index 72e080c0..5b679293 100644 --- a/frameworks/zone/BUILD.gn +++ b/frameworks/zone/BUILD.gn @@ -19,7 +19,7 @@ config("zone_util_public_configs") { "//third_party/icu/icu4c/source/common", "//third_party/icu/icu4c/source/common/unicode", "//third_party/icu/icu4c/source/i18n", - "//base/global/i18n_standard/interfaces/native/innerkits/zone/include", + "//base/global/i18n/interfaces/native/innerkits/zone/include", "//third_party/libphonenumber/cpp/src", "//third_party/protobuf/src", "//third_party/protobuf/src/google", @@ -43,5 +43,5 @@ ohos_shared_library("zone_util") { "//third_party/libphonenumber/cpp:phonenumber_standard", ] subsystem_name = "global" - part_name = "i18n_standard" + part_name = "i18n" } diff --git a/frameworks/zone/test/BUILD.gn b/frameworks/zone/test/BUILD.gn index b7a2d7d0..ebda0e93 100644 --- a/frameworks/zone/test/BUILD.gn +++ b/frameworks/zone/test/BUILD.gn @@ -13,7 +13,7 @@ import("//build/test.gni") -module_output_path = "i18n_standard/zone_util_test" +module_output_path = "i18n/zone_util_test" ohos_unittest("zone_util_test") { module_out_path = module_output_path @@ -38,7 +38,7 @@ ohos_unittest("zone_util_test") { include_dirs = [ "//third_party/googletest/googletest/include", "//third_party/googletest/googletest", - "//base/global/i18n_standard/interfaces/native/innerkits/zone/include", + "//base/global/i18n/interfaces/native/innerkits/zone/include", "//third_party/icu/icu4c/source/common/unicode", "//third_party/icu/icu4c/source/common", "//third_party/libphonenumber/cpp/src", @@ -47,7 +47,7 @@ ohos_unittest("zone_util_test") { "//third_party/protobuf/src/google/protobuf", ] deps = [ - "//base/global/i18n_standard/frameworks/zone:zone_util", + "//base/global/i18n/frameworks/zone:zone_util", "//third_party/libphonenumber/cpp:phonenumber_standard", "//utils/native/base:utils", ] diff --git a/interfaces/js/kits/BUILD.gn b/interfaces/js/kits/BUILD.gn index 9c10d17b..94c92563 100644 --- a/interfaces/js/kits/BUILD.gn +++ b/interfaces/js/kits/BUILD.gn @@ -22,8 +22,8 @@ group("build_module") { ohos_shared_library("intl") { include_dirs = [ - "//base/global/i18n_standard/frameworks/intl/include", - "//base/global/i18n_standard/interfaces/js/kits/include", + "//base/global/i18n/frameworks/intl/include", + "//base/global/i18n/interfaces/js/kits/include", "//base/hiviewdfx/interfaces/native/innerkits/include", "//foundation/ace/napi/native_engine", "//foundation/ace/napi/interfaces/kits", @@ -39,7 +39,7 @@ ohos_shared_library("intl") { sources = [ "src/intl_addon.cpp" ] deps = [ - "//base/global/i18n_standard/frameworks/intl:intl_util", + "//base/global/i18n/frameworks/intl:intl_util", "//foundation/ace/napi:ace_napi", "//third_party/icu/icu4c:shared_icui18n", "//third_party/icu/icu4c:shared_icuuc", @@ -48,13 +48,13 @@ ohos_shared_library("intl") { external_deps = [ "hiviewdfx_hilog_native:libhilog" ] relative_install_dir = "module" subsystem_name = "global" - part_name = "i18n_standard" + part_name = "i18n" } ohos_shared_library("i18n") { include_dirs = [ - "//base/global/i18n_standard/frameworks/intl/include", - "//base/global/i18n_standard/interfaces/js/kits/include", + "//base/global/i18n/frameworks/intl/include", + "//base/global/i18n/interfaces/js/kits/include", "//base/hiviewdfx/interfaces/native/innerkits/include", "//foundation/ace/napi/native_engine", "//foundation/ace/napi/interfaces/kits", @@ -70,8 +70,8 @@ ohos_shared_library("i18n") { sources = [ "src/i18n_addon.cpp" ] deps = [ - "//base/global/i18n_standard/frameworks/intl:intl_util", - "//base/global/i18n_standard/frameworks/intl:preferred_language", + "//base/global/i18n/frameworks/intl:intl_util", + "//base/global/i18n/frameworks/intl:preferred_language", "//third_party/icu/icu4c:shared_icui18n", "//third_party/icu/icu4c:shared_icuuc", "//third_party/libphonenumber/cpp:phonenumber_standard", @@ -82,5 +82,5 @@ ohos_shared_library("i18n") { ] relative_install_dir = "module" subsystem_name = "global" - part_name = "i18n_standard" + part_name = "i18n" }