@@ -956,27 +956,8 @@ - (void)setIsGpuDisabled:(BOOL)value {
956956#pragma mark - Locale updates
957957
958958- (void )onLocaleUpdated : (NSNotification *)notification {
959- // [NSLocale currentLocale] provides an iOS resolved locale if the
960- // supported locales are exposed to the iOS embedder. Here, we get
961- // currentLocale and pass it to dart:ui
959+ // Get and pass the user's preferred locale list to dart:ui.
962960 NSMutableArray <NSString *>* localeData = [[[NSMutableArray alloc ] init ] autorelease ];
963- NSLocale * platformResolvedLocale = [NSLocale currentLocale ];
964- NSString * languageCode = [platformResolvedLocale objectForKey: NSLocaleLanguageCode ];
965- NSString * countryCode = [platformResolvedLocale objectForKey: NSLocaleCountryCode ];
966- NSString * scriptCode = [platformResolvedLocale objectForKey: NSLocaleScriptCode ];
967- NSString * variantCode = [platformResolvedLocale objectForKey: NSLocaleVariantCode ];
968- if (languageCode) {
969- [localeData addObject: languageCode];
970- [localeData addObject: (countryCode ? countryCode : @" " )];
971- [localeData addObject: (scriptCode ? scriptCode : @" " )];
972- [localeData addObject: (variantCode ? variantCode : @" " )];
973- }
974- if (localeData.count != 0 ) {
975- [self .localizationChannel invokeMethod: @" setPlatformResolvedLocale" arguments: localeData];
976- }
977-
978- // Get and pass the user's preferred locale list to dart:ui
979- localeData = [[[NSMutableArray alloc ] init ] autorelease ];
980961 NSArray <NSString *>* preferredLocales = [NSLocale preferredLanguages ];
981962 for (NSString * localeID in preferredLocales) {
982963 NSLocale * locale = [[[NSLocale alloc ] initWithLocaleIdentifier: localeID] autorelease ];
0 commit comments