From 365cff79c1adb95149c45dbe8e5625bf73073e87 Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Tue, 25 Mar 2025 11:38:46 +0000 Subject: [PATCH] tools/installer: move language to external file This moves all language used in the installer to an embedded JSON file to allow for customisation per game. --- .../Controls/FinishStepControl.xaml | 24 ++++----- .../Controls/InstallSettingsStepControl.xaml | 49 ++++++++--------- .../Controls/InstallSourceControl.xaml | 11 ++-- .../Controls/InstallStepControl.xaml | 6 +-- .../Controls/SourceStepControl.xaml | 25 +++++---- .../Controls/TRXInstallWindow.xaml | 6 +-- .../Installers/InstallExecutor.cs | 6 +-- .../Installers/InstallUtils.cs | 20 +++---- .../TRX_InstallerLib/Models/FinishStep.cs | 2 +- .../Models/InstallSettingsStep.cs | 4 +- .../Models/InstallSourceViewModel.cs | 8 ++- .../TRX_InstallerLib/Models/InstallStep.cs | 2 +- .../TRX_InstallerLib/Models/Language.cs | 2 +- .../TRX_InstallerLib/Models/SourceStep.cs | 2 +- .../TRX_InstallerLib/Resources/Lang/en.json | 53 ++++++++++++++++++- .../TRX_InstallerLib/Resources/styles.xaml | 3 ++ .../TRX_InstallerLib/TRX_InstallerLib.csproj | 2 + .../Utils/ConditionalMarkupConverter.cs | 4 +- .../Utils/ConditionalViewTextConverter.cs | 13 +++++ .../TRX_InstallerLib/Utils/CueFile.cs | 5 +- .../TRX_InstallerLib/Utils/CueTrack.cs | 11 ++-- .../TRX_InstallerLib/Utils/FileBrowser.cs | 4 +- .../TRX_InstallerLib/Utils/ShortcutUtils.cs | 5 +- 23 files changed, 170 insertions(+), 97 deletions(-) create mode 100644 tools/installer/TRX_InstallerLib/Utils/ConditionalViewTextConverter.cs diff --git a/tools/installer/TRX_InstallerLib/Controls/FinishStepControl.xaml b/tools/installer/TRX_InstallerLib/Controls/FinishStepControl.xaml index 8c04ea48b..028c6e43f 100644 --- a/tools/installer/TRX_InstallerLib/Controls/FinishStepControl.xaml +++ b/tools/installer/TRX_InstallerLib/Controls/FinishStepControl.xaml @@ -6,7 +6,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:models="clr-namespace:TRX_InstallerLib.Models" d:DataContext="{d:DesignInstance Type=models:FinishStep}" - mc:Ignorable="d" + mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> @@ -14,19 +14,17 @@ - - Step 4: Done - + - - Installation complete. To configure more advanced features, you can edit the JSON files in the cfg/ directory with a text editor. - + - - Happy raiding :) - - - - + + diff --git a/tools/installer/TRX_InstallerLib/Controls/InstallSettingsStepControl.xaml b/tools/installer/TRX_InstallerLib/Controls/InstallSettingsStepControl.xaml index 3336554fe..e3f26cf76 100644 --- a/tools/installer/TRX_InstallerLib/Controls/InstallSettingsStepControl.xaml +++ b/tools/installer/TRX_InstallerLib/Controls/InstallSettingsStepControl.xaml @@ -7,7 +7,7 @@ xmlns:models="clr-namespace:TRX_InstallerLib.Models" xmlns:utils="clr-namespace:TRX_InstallerLib.Utils" d:DataContext="{d:DesignInstance Type=models:InstallSettingsStep}" - mc:Ignorable="d" + mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> @@ -20,9 +20,9 @@ - - Step 2: Installation options - + @@ -82,15 +82,10 @@ - Download music tracks - + + - - This option lets you download compatible music files for the game - automatically (60 MB). The legality of these files is disputable; - the most legal way to import the music to PC is to obtain them from - your own source - TR2 supports FLAC, OOG, MP3 and WAV files. - + @@ -100,33 +95,31 @@ - Download Unfinished Business expansion pack - + + - - The Unfinished Business expansion pack was made freeware. However, the Steam and GOG versions do not ship it. This option lets you download the expansion files automatically (6 MB). - + - - - Import saves + - - Imports existing savegame files. Only TombATI and TR1X savegame format is supported at this time. - + - - Create desktop shortcut - + @@ -136,9 +129,9 @@ -