Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix strings not localising #253

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions SIT.Manager/ViewModels/Settings/EftViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public partial class EftViewModel : SettingsViewModelBase
[ObservableProperty]
private string _sitEftInstallPath;

[ObservableProperty]
private bool _showEftInstallPathMissing;

public IAsyncRelayCommand ChangeInstallLocationCommand { get; }

public EftViewModel(IBarNotificationService barNotificationService,
Expand All @@ -36,10 +39,6 @@ public partial class EftViewModel : SettingsViewModelBase

BsgEftInstallPath = Path.GetDirectoryName(_installerService.GetEFTInstallPath()) ?? _localizationService.TranslateSource("EftViewModelBsgEftInstallPathMissing");
SitEftInstallPath = _configsService.Config.SitEftInstallPath;
if (string.IsNullOrEmpty(SitEftInstallPath))
{
SitEftInstallPath = _localizationService.TranslateSource("EftViewModelSitEftInstallPathMissing");
}

ChangeInstallLocationCommand = new AsyncRelayCommand(ChangeInstallLocation);
}
Expand Down Expand Up @@ -74,4 +73,10 @@ private async Task ChangeInstallLocation()
_barNotificationService.ShowError(_localizationService.TranslateSource("SettingsPageViewModelErrorTitle"), _localizationService.TranslateSource("SettingsPageViewModelConfigErrorEFTDescription"));
}
}

protected override void OnActivated()
{
base.OnActivated();
ShowEftInstallPathMissing = string.IsNullOrEmpty(SitEftInstallPath);
}
}
10 changes: 9 additions & 1 deletion SIT.Manager/Views/Settings/EftView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
TextWrapping="WrapWithOverflow"
Text="{Binding SitEftInstallPath}"/>
Text="{Binding SitEftInstallPath}"
IsVisible="{Binding !ShowEftInstallPathMissing}"/>
<TextBlock Grid.Column="1"
Grid.Row="1"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
TextWrapping="WrapWithOverflow"
Text="{DynamicResource EftViewModelSitEftInstallPathMissing}"
IsVisible="{Binding ShowEftInstallPathMissing}"/>
<Button Grid.Column="2"
Grid.Row="1"
VerticalAlignment="Center"
Expand Down
Loading