From a8b0d2a2ce5ccaa0b5f15903db14a7265f72b6df Mon Sep 17 00:00:00 2001 From: GreemDev Date: Sun, 7 Dec 2025 02:03:10 -0600 Subject: [PATCH] Localize all (I think...) previously hardcoded english strings in the setup wizard --- assets/locales.json | 300 ++++++++++++++++++ .../Pages/Fw/SetupFirmwarePageContext.cs | 95 +++--- .../Pages/GameDirs/SetupGameDirsPage.axaml | 2 +- .../GameDirs/SetupGameDirsPageContext.cs | 13 +- .../Pages/Keys/SetupKeysPageContext.cs | 11 +- .../SetupWizard/RyujinxSetupWizard.Steps.cs | 7 +- .../UI/SetupWizard/RyujinxSetupWizard.cs | 2 +- 7 files changed, 368 insertions(+), 62 deletions(-) diff --git a/assets/locales.json b/assets/locales.json index 0d71c95bd..5f6887690 100644 --- a/assets/locales.json +++ b/assets/locales.json @@ -25067,6 +25067,56 @@ "zh_TW": "" } }, + { + "ID": "SetupWizardKeysPageHelpText", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Not sure how to get your keys?", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardKeysPageSkipText", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Skipped setting up keys as you already have a valid key installation and did not choose a folder to install from.\nClick '{0}' if you wish to reinstall your keys.", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, { "ID": "SetupWizardFirmwarePageTitle", "Translations": { @@ -25217,6 +25267,156 @@ "zh_TW": "" } }, + { + "ID": "SetupWizardFirmwarePageInstallSuccessNotificationTitle", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Firmware installed", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageInstallSuccessNotificationText", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Installed firmware version {0}.", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageInstallFailNotificationTitle", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Firmware not installed", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageInstallFailNotificationText", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "It seems some error occurred when trying to install the firmware at path '{0}'.\nDid that folder contain a firmware dump?", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageHelpText", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Not sure how to get your firmware off of your Switch?", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardFirmwarePageSkipText", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Skipped setting up firmware as you already have a valid firmware installation and did not choose a folder or file to install from.\nClick '{0}' if you wish to overwrite your firmware.", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, { "ID": "SetupWizardGameDirsPageTitle", "Translations": { @@ -25242,6 +25442,81 @@ "zh_TW": "" } }, + { + "ID": "SetupWizardGameDirsPageDescription", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "{0} can be pointed at any number of folders to look for your games, updates, and DLC content.\nAt least one folder must be specified in game directories before continuing.", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardGameDirsPageNoFoldersSelectedError", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "At least one folder for games must be selected; otherwise the UI will be empty.", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, + { + "ID": "SetupWizardGameDirsPageHelpText", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Not sure how to get your games, updates, and/or DLC onto your PC?", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, { "ID": "SetupWizardFinalPageTitle", "Translations": { @@ -25316,6 +25591,31 @@ "zh_CN": "", "zh_TW": "" } + }, + { + "ID": "SetupWizardHelpLinkButton", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Click here to view a guide.", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } } ] } diff --git a/src/Ryujinx/UI/SetupWizard/Pages/Fw/SetupFirmwarePageContext.cs b/src/Ryujinx/UI/SetupWizard/Pages/Fw/SetupFirmwarePageContext.cs index 8d1d4439e..3bd78956c 100644 --- a/src/Ryujinx/UI/SetupWizard/Pages/Fw/SetupFirmwarePageContext.cs +++ b/src/Ryujinx/UI/SetupWizard/Pages/Fw/SetupFirmwarePageContext.cs @@ -19,39 +19,40 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages { public partial class SetupFirmwarePageContext() : SetupWizardPageContext(LocaleKeys.SetupWizardFirmwarePageTitle) { - [ObservableProperty] - public partial string FirmwareSourcePath { get; set; } + [ObservableProperty] public partial string FirmwareSourcePath { get; set; } [RelayCommand] private static async Task BrowseFile(TextBox tb) { - Optional result = await RyujinxApp.MainWindow.ViewModel.StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions - { - Title = LocaleManager.Instance[LocaleKeys.SetupWizardFirmwarePageFilePopupTitle], - FileTypeFilter = new List - { - new(LocaleManager.Instance[LocaleKeys.FileDialogAllTypes]) + Optional result = + await RyujinxApp.MainWindow.ViewModel.StorageProvider.OpenSingleFilePickerAsync( + new FilePickerOpenOptions { - Patterns = ["*.xci", "*.zip"], - AppleUniformTypeIdentifiers = ["com.ryujinx.xci", "public.zip-archive"], - MimeTypes = ["application/x-nx-xci", "application/zip"], - }, - new("XCI") - { - Patterns = ["*.xci"], - AppleUniformTypeIdentifiers = ["com.ryujinx.xci"], - MimeTypes = ["application/x-nx-xci"], - }, - new("ZIP") - { - Patterns = ["*.zip"], - AppleUniformTypeIdentifiers = ["public.zip-archive"], - MimeTypes = ["application/zip"], - } - } - }); + Title = LocaleManager.Instance[LocaleKeys.SetupWizardFirmwarePageFilePopupTitle], + FileTypeFilter = new List + { + new(LocaleManager.Instance[LocaleKeys.FileDialogAllTypes]) + { + Patterns = ["*.xci", "*.zip"], + AppleUniformTypeIdentifiers = ["com.ryujinx.xci", "public.zip-archive"], + MimeTypes = ["application/x-nx-xci", "application/zip"], + }, + new("XCI") + { + Patterns = ["*.xci"], + AppleUniformTypeIdentifiers = ["com.ryujinx.xci"], + MimeTypes = ["application/x-nx-xci"], + }, + new("ZIP") + { + Patterns = ["*.zip"], + AppleUniformTypeIdentifiers = ["public.zip-archive"], + MimeTypes = ["application/zip"], + } + } + }); - if (result.TryGet(out IStorageFile firmwareFile)) + if (result.TryGet(out IStorageFile firmwareFile)) { tb.Text = firmwareFile.TryGetLocalPath(); } @@ -60,12 +61,14 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages [RelayCommand] private static async Task BrowseFolder(TextBox tb) { - Optional result = await RyujinxApp.MainWindow.ViewModel.StorageProvider.OpenSingleFolderPickerAsync(new FolderPickerOpenOptions - { - Title = LocaleManager.Instance[LocaleKeys.SetupWizardFirmwarePageFolderPopupTitle] - }); + Optional result = + await RyujinxApp.MainWindow.ViewModel.StorageProvider.OpenSingleFolderPickerAsync( + new FolderPickerOpenOptions + { + Title = LocaleManager.Instance[LocaleKeys.SetupWizardFirmwarePageFolderPopupTitle] + }); - if (result.TryGet(out IStorageFolder firmwareFolder)) + if (result.TryGet(out IStorageFolder firmwareFolder)) { tb.Text = firmwareFolder.TryGetLocalPath(); } @@ -81,14 +84,14 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages grid.Children.Add(new TextBlock { - Text = "Not sure how to get your firmware off of your Switch?", + Text = LocaleManager.Instance[LocaleKeys.SetupWizardFirmwarePageHelpText], HorizontalAlignment = HorizontalAlignment.Center, GridRow = 0 }); grid.Children.Add(new HyperlinkButton { - Content = "Click here to view a guide.", + Content = LocaleManager.Instance[LocaleKeys.SetupWizardHelpLinkButton], NavigateUri = new Uri(SharedConstants.DumpFirmwareWikiUrl), HorizontalAlignment = HorizontalAlignment.Center, GridRow = 1 @@ -102,8 +105,12 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages if (string.IsNullOrEmpty(FirmwareSourcePath) && RyujinxSetupWizard.HasFirmware) { NotificationManager.Information( - title: LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle], - "Skipped setting up firmware as you already have a valid firmware installation and did not choose a folder or file to install from.\n\nClick 'Back' if you wish to overwrite your firmware."); + title: LocaleManager.Instance[LocaleKeys.RyujinxInfo], + text: LocaleManager.GetFormatted( + LocaleKeys.SetupWizardFirmwarePageSkipText, + LocaleManager.Instance[LocaleKeys.SetupWizardActionBack] + ) + ); return Result.Success; // This handles the user selecting no file/dir and just hitting Next. } @@ -117,18 +124,24 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages if (installedFwVer != null) { NotificationManager.Information( - "Firmware installed", - $"Installed firmware version {installedFwVer.VersionString}." + LocaleManager.Instance[LocaleKeys.SetupWizardFirmwarePageInstallSuccessNotificationTitle], + LocaleManager.GetFormatted( + LocaleKeys.SetupWizardFirmwarePageInstallSuccessNotificationTitle, + installedFwVer.VersionString + ) ); } else { NotificationManager.Error( - "Firmware not installed", - $"It seems some error occurred when trying to install the firmware at path '{FirmwareSourcePath}'." + - "\nDid that folder contain a firmware dump?" + LocaleManager.Instance[LocaleKeys.SetupWizardFirmwarePageInstallFailNotificationTitle], + LocaleManager.GetFormatted( + LocaleKeys.SetupWizardFirmwarePageInstallFailNotificationText, + FirmwareSourcePath + ) ); } + RyujinxApp.MainWindow.ViewModel.RefreshFirmwareStatus(installedFwVer, allowNullVersion: true); // Purge Applet Cache. diff --git a/src/Ryujinx/UI/SetupWizard/Pages/GameDirs/SetupGameDirsPage.axaml b/src/Ryujinx/UI/SetupWizard/Pages/GameDirs/SetupGameDirsPage.axaml index 8d05e0656..295cf91e1 100644 --- a/src/Ryujinx/UI/SetupWizard/Pages/GameDirs/SetupGameDirsPage.axaml +++ b/src/Ryujinx/UI/SetupWizard/Pages/GameDirs/SetupGameDirsPage.axaml @@ -11,8 +11,8 @@ Margin="10" Spacing="10" Orientation="Vertical" HorizontalAlignment="Stretch"> + - ()) - return false; - - if (!res) + if (!gdContext.CompleteStep()) goto Retry; return true; diff --git a/src/Ryujinx/UI/SetupWizard/RyujinxSetupWizard.cs b/src/Ryujinx/UI/SetupWizard/RyujinxSetupWizard.cs index 5db3f724f..18209f0ac 100644 --- a/src/Ryujinx/UI/SetupWizard/RyujinxSetupWizard.cs +++ b/src/Ryujinx/UI/SetupWizard/RyujinxSetupWizard.cs @@ -62,7 +62,7 @@ namespace Ryujinx.Ava.UI.SetupWizard // Fuck it, weird window height hack to do it instead. // 120 is not exact, just a random number. Looks fine though. NotificationPosition.TopCenter, - margin: new Thickness(0, _window.Height - 120, 0, 0) + margin: new Thickness(0, _window.Height - 135, 0, 0) ); RyujinxSetupWizardWindow.IsOpen = true;