Skip to content

Commit

Permalink
language presist after app close.
Browse files Browse the repository at this point in the history
  • Loading branch information
DineshSolanki committed Aug 4, 2021
1 parent e1fad3e commit 57e03ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion FoliCon/Properties/Langs/Lang.hi.resx
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
<value>बनाए गए आइकन:</value>
</data>
<data name="Idle" xml:space="preserve">
<value>बेकार</value>
<value>निष्क्रिय</value>
</data>
<data name="Ignore" xml:space="preserve">
<value>नज़रअंदाज़ करना</value>
Expand Down
11 changes: 9 additions & 2 deletions FoliCon/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class MainWindowViewModel : BindableBase, IFileDragDropTarget, IDisposabl
private string _searchMode = "Movie";
private bool _isSearchModeVisible = true;
private bool _stopIconDownload;
private Languages _appLanguage;
private TMDbLib.Client.TMDbClient _tmdbClient;
private IGDB.IGDBClient _igdbClient;
private IgdbClass _igdbObject;
Expand Down Expand Up @@ -145,6 +146,11 @@ public bool IsBusy
set => SetProperty(ref _isBusy, value);
}

public Languages AppLanguage
{
get => _appLanguage;
set => SetProperty(ref _appLanguage, value);
}
#endregion GetterSetters

#region DelegateCommands
Expand Down Expand Up @@ -197,7 +203,8 @@ public MainWindowViewModel(IDialogService dialogService)
Services.Tracker.Configure<MainWindowViewModel>()
.Property(p => p.IsRatingVisible, true)
.Property(p => p.IsPosterMockupUsed, true)
.Property(p => p.IsPosterWindowShown)
.Property(p => p.IsPosterWindowShown, false)
.Property(p =>p.AppLanguage, Languages.English)
.PersistOn(nameof(PropertyChanged));
Services.Tracker.Track(this);
Util.CheckForUpdate(true);
Expand Down Expand Up @@ -276,7 +283,7 @@ private async System.Threading.Tasks.Task ProcessPosterModeAsync()
GlobalVariables.SkipAll = false;
foreach (var itemTitle in Fnames)
{
var fullFolderPath = SelectedFolder + "\\" + itemTitle;
var fullFolderPath = $@"{SelectedFolder}\{itemTitle}";
var dialogResult = false;
StatusBarProperties.AppStatus = LangProvider.GetLang("SearchingWithCount").Format(itemTitle);
// TODO: Set cursor to WAIT.
Expand Down
2 changes: 1 addition & 1 deletion FoliCon/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<MenuItem x:Name="MenuApiConfigBtn" Header="{ex:Lang Key={x:Static langs:LangKeys.APIKeysConfiguration}}"
Command="{Binding ApiConfigCommand}" />
<Separator />
<hc:ComboBox x:Name="CmbLanguage" AutoComplete="True" ItemsSource="{Binding Source={hc:EnumBindingSource {x:Type models:Languages}}}" IsEditable="False" hc:Poptip.Content="{ex:Lang Key={x:Static langs:LangKeys.ChangeLanguage}}" hc:Poptip.Placement="BottomRight" SelectedIndex="0" SelectionChanged="CmbLanguage_OnSelectionChanged"/>
<hc:ComboBox x:Name="CmbLanguage" AutoComplete="True" ItemsSource="{Binding Source={hc:EnumBindingSource {x:Type models:Languages}}}" IsEditable="False" hc:Poptip.Content="{ex:Lang Key={x:Static langs:LangKeys.ChangeLanguage}}" hc:Poptip.Placement="BottomRight" SelectedItem ="{Binding Path=AppLanguage}" SelectionChanged="CmbLanguage_OnSelectionChanged"/>
</MenuItem>
<MenuItem x:Name="MenuRExbtn" Header="{ex:Lang Key={x:Static langs:LangKeys.RestartExplorer}}"
ToolTip="{ex:Lang Key={x:Static langs:LangKeys.RestartExplorerTooltip}}"
Expand Down

0 comments on commit 57e03ff

Please sign in to comment.