Repository: flutter
Issue: Localizations.override override the Localization for the whole app
Labels: framework,a: internationalization,f: routes,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.19,found in release: 3.20

### Steps to reproduce

Add two different localization files. (e.g. en, fr).

Set up localizations:
```dart
MaterialApp(
      localizationsDelegates: const [
        S.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      locale: const Locale('fr'),
      supportedLocales: S.delegate.supportedLocales,
);
```

For a quick example, create two screens and use the "LicensePage" widget as one of them.

### Expected results

The language override stays locally for only the subtree of widgets and does not override the global used language.

### Actual results

This seems to cause an override of the localization everywhere in the app. I've tested this with the Navigator and Router mechanism.
The moment you open a license on the screen and navigate back (not via popping the route but directly switching the screen) the language will be changed in the whole app to "en_US".

### Code sample

<details open><summary>Code sample</summary>
Use somewhere in your app 

```dart
... 
Localizations.override(
  locale: const Locale('en', 'US'),
  context: context,
  child: child,
)
```
</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.16.9, on macOS 14.2.1 23C71 darwin-arm64, locale de-DE)
    • Flutter version 3.16.9 on channel stable at /Users/YukiAttano/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 41456452f2 (3 weeks ago), 2024-01-25 10:06:23 -0800
    • Engine revision f40e976bed
    • Dart version 3.2.6
    • DevTools version 2.28.5

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/YukiAttano/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] Connected device (3 available)
    • Pixel 6a (mobile) • 29191JEGR01968 • android-arm64  • Android 14 (API 34)
    • macOS (desktop)   • macos          • darwin-arm64   • macOS 14.2.1 23C71 darwin-arm64
    • Chrome (web)      • chrome         • web-javascript • Google Chrome 121.0.6167.160
    ! Error: Browsing on the local area network for iPhone 12 Pro Fury. Ensure the device is unlocked and attached with a cable or associated with the same local area network
      as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>