Fix LastQueryMode's selection display when switching language#1410
Merged
jjw24 merged 4 commits intoFlow-Launcher:devfrom Sep 27, 2022
Merged
Fix LastQueryMode's selection display when switching language#1410jjw24 merged 4 commits intoFlow-Launcher:devfrom
jjw24 merged 4 commits intoFlow-Launcher:devfrom
Conversation
taooceros
reviewed
Sep 25, 2022
Comment on lines
-137
to
+143
| List<LastQueryMode> modes = new List<LastQueryMode>(); | ||
| var enums = (Infrastructure.UserSettings.LastQueryMode[])Enum.GetValues(typeof(Infrastructure.UserSettings.LastQueryMode)); | ||
| foreach (var e in enums) | ||
| if (_lastQueryModes.Count == 0) | ||
| { | ||
| var key = $"LastQuery{e}"; | ||
| var display = _translater.GetTranslation(key); | ||
| var m = new LastQueryMode { Display = display, Value = e, }; | ||
| modes.Add(m); | ||
| _lastQueryModes = InitLastQueryModes(); | ||
| } | ||
| return modes; | ||
| return _lastQueryModes; |
Member
There was a problem hiding this comment.
Thanks for the fix!
Though, I didn't see why this can fix the issue. It seems like you only add a cache for that (which is super reasonable though)?
Would you please explain a bit?
Contributor
Author
There was a problem hiding this comment.
1.LastQueryMode add INotifyPropertyChanged interface
public class LastQueryMode : BaseModel
2.when modifying the language(Language set property),call UpdateLastQueryModeDisplay();
Member
|
Just as a quick note, you don't have to modify all language file to add new translation string, just modify the base one (en.xaml) and the ones you do want to translate (se.xaml, zh-cn.xaml, zh-tw.xaml for this case) and others will be added automatically by the integration. |
…aml) and the ones I do want to translate
taooceros
approved these changes
Sep 27, 2022
Merged
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.
Fixed LastQueryMode's selection display when switching language and added Spanish translation.
Close #1409