Skip to content

Conversation

@NeedJustWord
Copy link
Contributor

@NeedJustWord NeedJustWord commented Sep 25, 2022

Fixed LastQueryMode's selection display when switching language and added Spanish translation.
Close #1409

@NeedJustWord NeedJustWord changed the title Spanish translation #1409 Spanish translation #1409,fix when modifying the language,LastQueryMode's Display no immediate translation 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

@NeedJustWord NeedJustWord Sep 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.LastQueryMode add INotifyPropertyChanged interface
public class LastQueryMode : BaseModel

2.when modifying the language(Language set property),call UpdateLastQueryModeDisplay();

@taooceros
Copy link
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
@jjw24 jjw24 added bug Something isn't working kind/i18n labels Sep 27, 2022
@jjw24 jjw24 added this to the 1.10.0 milestone Sep 27, 2022
@jjw24 jjw24 modified the milestones: 1.10.0, 1.9.5 Sep 27, 2022
@jjw24 jjw24 merged commit 16b81c8 into Flow-Launcher:dev Sep 27, 2022
@jjw24 jjw24 mentioned this pull request Sep 27, 2022
@jjw24 jjw24 modified the milestones: 1.9.5, 1.10.0 Sep 27, 2022
@jjw24 jjw24 changed the title Spanish translation #1409,fix when modifying the language,LastQueryMode's Display no immediate translation Fix LastQueryMode's selection display when switching language Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working kind/i18n

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dev] Spanish translation (FL 1.10.0_ES)_3

3 participants