From bc04b9fc453bd6108c51f2cd1e92a0846dfd446e Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Tue, 10 Oct 2023 16:02:29 -0400 Subject: [PATCH] [iOS] Set outer bundle override to ensure locale/icu sets up correctly --- ios/app/brave_core_main.mm | 4 +++- ios/app/brave_main_delegate.mm | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ios/app/brave_core_main.mm b/ios/app/brave_core_main.mm index 6d4a8d9c9eb2..9c295475436b 100644 --- a/ios/app/brave_core_main.mm +++ b/ios/app/brave_core_main.mm @@ -485,7 +485,9 @@ - (BraveP3AUtils*)p3aUtils { } + (bool)initializeICUForTesting { - base::apple::SetOverrideFrameworkBundle([NSBundle bundleForClass:self]); + NSBundle* bundle = [NSBundle bundleForClass:self]; + base::apple::SetOverrideOuterBundle(bundle); + base::apple::SetOverrideFrameworkBundle(bundle); return base::i18n::InitializeICU(); } diff --git a/ios/app/brave_main_delegate.mm b/ios/app/brave_main_delegate.mm index f2d7595e75b5..27df7b37204a 100644 --- a/ios/app/brave_main_delegate.mm +++ b/ios/app/brave_main_delegate.mm @@ -49,8 +49,9 @@ @implementation BundleLookupClass } // namespace BraveMainDelegate::BraveMainDelegate() { - base::apple::SetOverrideFrameworkBundle( - [NSBundle bundleForClass:[BundleLookupClass class]]); + NSBundle* bundle = [NSBundle bundleForClass:[BundleLookupClass class]]; + base::apple::SetOverrideOuterBundle(bundle); + base::apple::SetOverrideFrameworkBundle(bundle); } BraveMainDelegate::~BraveMainDelegate() {}