ui(client): translation

This commit is contained in:
Pascal
2025-11-06 11:42:08 +01:00
parent a89145071d
commit 6a6fd7efe6
8 changed files with 411 additions and 128 deletions

View File

@@ -2,8 +2,8 @@
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.Platform.Storage;
using ModpackUpdater.Apps.Client.Gui.LangRes;
using ModpackUpdater.Manager;
using ModpackUpdater.My.Resources;
using MsBox.Avalonia;
using MsBox.Avalonia.Enums;
using Pilz.Extensions;
@@ -110,21 +110,21 @@ public partial class MainForm : Window
if (modpackInfo == null || string.IsNullOrWhiteSpace(TextBoxMinecraftProfileFolder.Text) /*|| modpackInfo.Valid*/)
{
SetStatus(LangRes.StatusText_MinecraftProfileWarning, Symbols.Fluent.GetImageSource(SymbolsFluent.warning_shield));
SetStatus(GeneralLangRes.MinecraftProfileFolderSeemsInvalid, Symbols.Fluent.GetImageSource(SymbolsFluent.warning_shield));
ButtonCheckForUpdates.IsEnabled = false;
ButtonInstall.IsEnabled = false;
return false;
}
else if (updateConfig == null || string.IsNullOrWhiteSpace(TextBoxModpackConfig.Text))
{
SetStatus(LangRes.StatusText_ConfigIncompleteOrNotLoaded, Symbols.Fluent.GetImageSource(SymbolsFluent.warning_shield));
SetStatus(GeneralLangRes.ConfigIncompleteOrNotLoaded, Symbols.Fluent.GetImageSource(SymbolsFluent.warning_shield));
ButtonCheckForUpdates.IsEnabled = false;
ButtonInstall.IsEnabled = false;
return false;
}
else if (updateConfig.Maintenance && !updateOptions.IgnoreMaintenance)
{
SetStatus(LangRes.StatusText_Maintenance, Symbols.Fluent.GetImageSource(SymbolsFluent.services));
SetStatus(GeneralLangRes.UpdateServerInMaintenance, Symbols.Fluent.GetImageSource(SymbolsFluent.services));
ButtonCheckForUpdates.IsEnabled = false;
ButtonInstall.IsEnabled = false;
return false;
@@ -146,28 +146,28 @@ public partial class MainForm : Window
void error()
{
SetStatus(LangRes.StatusText_ErrorWhileUpdateCheckOrUpdate, Symbols.Fluent.GetImageSource(SymbolsFluent.close));
SetStatus(GeneralLangRes.ErrorOnUpdateCheckOrUpdating, Symbols.Fluent.GetImageSource(SymbolsFluent.close));
currentUpdating = false;
}
void installing()
{
SetStatus(LangRes.StatusText_Installing, Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer));
SetStatus(GeneralLangRes.Installing, Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer));
currentUpdating = true;
}
void updatesAvailable()
{
SetStatus(LangRes.StatusText_UpdateAvailable, Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer));
SetStatus(GeneralLangRes.AnUpdateIsAvailable, Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer));
}
void everythingOk()
{
SetStatus(LangRes.StatusTest_EverythingOk, Symbols.Fluent.GetImageSource(SymbolsFluent.done));
SetStatus(GeneralLangRes.EverythingIsRightAndUpToDate, Symbols.Fluent.GetImageSource(SymbolsFluent.done));
currentUpdating = false;
}
// Check only if not pressed "install", not really needed otherwise.
if (lastUpdateCheckResult is null || !doInstall || repair)
{
SetStatus(LangRes.StatusText_CheckingForUpdates, Symbols.Fluent.GetImageSource(SymbolsFluent.update));
SetStatus(GeneralLangRes.CheckingForUpdates, Symbols.Fluent.GetImageSource(SymbolsFluent.update));
// Check for extras once again
updateOptions.IncludeExtras = features != null && features.IsEnabled(ModpackFeatures.FeatureAllowExtas, new AllowExtrasFeatureContext(modpackInfo));
@@ -263,9 +263,9 @@ public partial class MainForm : Window
private async void MainForm_Loaded(object? sender, RoutedEventArgs e)
{
var updater = new AppUpdater(Program.UPDATE_URL);
if (await updater.Check() && await MessageBoxManager.GetMessageBoxStandard(LangRes.MsgBox_UpdateAvailable_Title, LangRes.MsgBox_UpdateAvailable, ButtonEnum.YesNo).ShowWindowDialogAsync(this) == ButtonResult.Ok)
if (await updater.Check() && await MessageBoxManager.GetMessageBoxStandard(MsgBoxLangRes.UpdateAvailable_Title, MsgBoxLangRes.UpdateAvailable, ButtonEnum.YesNo).ShowWindowDialogAsync(this) == ButtonResult.Ok)
{
SetStatus(LangRes.StatusText_InstallingAppUpdate, Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer));
SetStatus(GeneralLangRes.DownloadProgramUpdate, Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer));
IsEnabled = false;
await updater.Install();
//Application.Restart(); // FIXME
@@ -297,7 +297,7 @@ public partial class MainForm : Window
{
var filePaths = await StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
{
Title = LangRes.FileDialog_SelectMinecraftProfileFolder,
Title = GeneralLangRes.SelectMinecraftProfileFolder,
SuggestedStartLocation = await StorageProvider.TryGetFolderFromPathAsync(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)),
AllowMultiple = false,
});