diff --git a/kits/BUILD.gn b/kits/BUILD.gn index 23cef7c28eb003bd25756b54257bec173b7fef42..6041fcf66801f8e30fc718992535404bf688c88c 100755 --- a/kits/BUILD.gn +++ b/kits/BUILD.gn @@ -28,14 +28,15 @@ config("appkit_config") { "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/include/appmgr", "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content", - "//base/global/resmgr_standard/interfaces/innerkits/include", ] } config("appkit_public_config") { visibility = [ ":*" ] - include_dirs = - [ "//base/global/resmgr_standard/interfaces/innerkits/include" ] + include_dirs = [ + "//base/global/resmgr_standard/interfaces/innerkits/include", + "//third_party/icu/icu4c/source/common", + ] } #build bin @@ -126,7 +127,6 @@ ohos_shared_library("appkit_native") { "$SUBSYSTEM_DIR/common:libappexecfwk_common", "$SUBSYSTEM_DIR/interfaces/innerkits/appexecfwk_base:appexecfwk_base", "$SUBSYSTEM_DIR/interfaces/innerkits/appexecfwk_core:appexecfwk_core", - "//base/global/resmgr_standard/frameworks/resmgr:global_resmgr", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", @@ -136,6 +136,10 @@ ohos_shared_library("appkit_native") { "//utils/native/base:utils", ] + public_deps = [ + "//base/global/resmgr_standard/frameworks/resmgr:global_resmgr", + ] + external_deps = [ "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", diff --git a/kits/appkit/native/app/src/context_container.cpp b/kits/appkit/native/app/src/context_container.cpp index 6ed8c8ecb47166d202d5c81d162a83d798f2b718..61dd41a03d85c18e20c89ab3615effcf9b44b6be 100755 --- a/kits/appkit/native/app/src/context_container.cpp +++ b/kits/appkit/native/app/src/context_container.cpp @@ -686,9 +686,9 @@ void ContextContainer::InitResourceManager(BundleInfo &bundleInfo, std::shared_p resConfig->SetLocaleInfo("zh", "Hans", "CN"); if (resConfig->GetLocaleInfo() != nullptr) { APP_LOGI("ContextContainer::InitResourceManager language: %{public}s, script: %{public}s, region: %{public}s,", - resConfig->GetLocaleInfo()->GetLanguage(), - resConfig->GetLocaleInfo()->GetScript(), - resConfig->GetLocaleInfo()->GetRegion()); + resConfig->GetLocaleInfo()->getLanguage(), + resConfig->GetLocaleInfo()->getScript(), + resConfig->GetLocaleInfo()->getCountry()); } else { APP_LOGI("ContextContainer::InitResourceManager language: GetLocaleInfo is null."); } diff --git a/kits/appkit/native/app/src/main_thread.cpp b/kits/appkit/native/app/src/main_thread.cpp index 25a80e9e764f082e355cc78db897743995163bf1..3e6dc7fbf2308c5ee43c5eb5746f934e71b4a3d2 100644 --- a/kits/appkit/native/app/src/main_thread.cpp +++ b/kits/appkit/native/app/src/main_thread.cpp @@ -626,12 +626,12 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData) std::unique_ptr resConfig(Global::Resource::CreateResConfig()); resConfig->SetLocaleInfo("zh", "Hans", "CN"); - const Global::Resource::LocaleInfo *localeInfo = resConfig->GetLocaleInfo(); + const icu::Locale *localeInfo = resConfig->GetLocaleInfo(); if (localeInfo != nullptr) { APP_LOGI("MainThread::handleLaunchApplication language: %{public}s, script: %{public}s, region: %{public}s,", - localeInfo->GetLanguage(), - localeInfo->GetScript(), - localeInfo->GetRegion()); + localeInfo->getLanguage(), + localeInfo->getScript(), + localeInfo->getCountry()); } else { APP_LOGI("MainThread::handleLaunchApplication localeInfo is nullptr."); }