Repository navigation
feat(settings): apply a language change without restarting - #10
Merged
Merged
Conversation
Picking a language in Settings > General now takes effect in place. The Settings window and the menu-bar / tray menu switch right away; the screenshot overlay follows on the next screenshot, the Image Editor when its window regains focus, and the recording strip on the next recording. The restart hint and button under the language picker are gone.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause
Changing the language in Settings > General only took effect after restarting Glimpr. Each engine resolved the choice once at boot, the macOS menu-bar strings were resolved once per launch, and the Windows tray and recording-strip labels were sent once at boot.
Change
lib/settings/app_locale.dart:loadAppLocaleOverridecan be called again and reports whether the language changed.syncNativeLanguagesends the Windows tray and recording-strip labels (moved here fromlib/main.dart) and, on macOS, tells the native side to re-read the choice.lib/settings/settings_app.dart: picking a language reloads it, rebuilds the window, updates the native strings, and refreshes the tray update label and the What's new sections. The restart hint and button under the language picker are removed, together with the stringsettingsLanguageAppliesAfterRestart.lib/overlay/overlay_app.dart: the overlay engine re-resolves the language after each reveal and after a Settings detour.lib/image_editor/image_editor_app.dart: the Image Editor re-resolves the language when its window regains focus or Settings closes.macos/Runner/MainFlutterWindow.swift,macos/Runner/StatusItemController.swift: alanguageChangedcall re-reads the choice, rebuilds the menu-bar menu (keeping the recording state, the recent list and the update label) and re-applies the window titles.windows/runner/record_channel.cpp: comment only.When each surface follows a change: the Settings window and the menu-bar / tray menu right away; the screenshot overlay on the next screenshot; an open Image Editor when its window regains focus; the recording strip on the next recording.
Verification
flutter analyzeand the fullflutter testsuite pass on macOS and on Windows.flutter build macos --debugandflutter build windows --releasesucceed.