diff --git a/src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs b/src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs index a7dff2a0ce5e..804c8feb4f4b 100644 --- a/src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs +++ b/src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs @@ -199,28 +199,28 @@ public string Password public ImmutableList CompressionLevels { get; } = [ - new CompressionLevelItem(ArchiveCompressionLevels.Ultra, "CompressionLevelUltra".GetLocalizedResource()), - new CompressionLevelItem(ArchiveCompressionLevels.High, "CompressionLevelHigh".GetLocalizedResource()), - new CompressionLevelItem(ArchiveCompressionLevels.Normal, "CompressionLevelNormal".GetLocalizedResource()), - new CompressionLevelItem(ArchiveCompressionLevels.Low, "CompressionLevelLow".GetLocalizedResource()), - new CompressionLevelItem(ArchiveCompressionLevels.Fast, "CompressionLevelFast".GetLocalizedResource()), - new CompressionLevelItem(ArchiveCompressionLevels.None, "CompressionLevelNone".GetLocalizedResource()), + new CompressionLevelItem(ArchiveCompressionLevels.Ultra, Strings.CompressionLevelUltra.GetLocalizedResource()), + new CompressionLevelItem(ArchiveCompressionLevels.High, Strings.CompressionLevelHigh.GetLocalizedResource()), + new CompressionLevelItem(ArchiveCompressionLevels.Normal, Strings.CompressionLevelNormal.GetLocalizedResource()), + new CompressionLevelItem(ArchiveCompressionLevels.Low, Strings.CompressionLevelLow.GetLocalizedResource()), + new CompressionLevelItem(ArchiveCompressionLevels.Fast, Strings.CompressionLevelFast.GetLocalizedResource()), + new CompressionLevelItem(ArchiveCompressionLevels.None, Strings.CompressionLevelNone.GetLocalizedResource()), ]; public ImmutableList SplittingSizes { get; } = [ - new(ArchiveSplittingSizes.None, "Do not split".GetLocalizedResource()), + new(ArchiveSplittingSizes.None, Strings.Do_not_split.GetLocalizedResource()), new(ArchiveSplittingSizes.Mo10, ToSizeText(10)), new(ArchiveSplittingSizes.Mo100, ToSizeText(100)), - new(ArchiveSplittingSizes.Cd650, ToSizeText(650), "CD".GetLocalizedResource()), - new(ArchiveSplittingSizes.Cd700, ToSizeText(700), "CD".GetLocalizedResource()), + new(ArchiveSplittingSizes.Cd650, ToSizeText(650), Strings.CD.GetLocalizedResource()), + new(ArchiveSplittingSizes.Cd700, ToSizeText(700), Strings.CD.GetLocalizedResource()), new(ArchiveSplittingSizes.Mo1024, ToSizeText(1024)), new(ArchiveSplittingSizes.Mo2048, ToSizeText(2048)), - new(ArchiveSplittingSizes.Fat4092, ToSizeText(4092), "FAT".GetLocalizedResource()), - new(ArchiveSplittingSizes.Dvd4480, ToSizeText(4480), "DVD".GetLocalizedResource()), + new(ArchiveSplittingSizes.Fat4092, ToSizeText(4092), Strings.FAT.GetLocalizedResource()), + new(ArchiveSplittingSizes.Dvd4480, ToSizeText(4480), Strings.DVD.GetLocalizedResource()), new(ArchiveSplittingSizes.Mo5120, ToSizeText(5120)), - new(ArchiveSplittingSizes.Dvd8128, ToSizeText(8128), "DVD".GetLocalizedResource()), - new(ArchiveSplittingSizes.Bd23040, ToSizeText(23040), "Bluray".GetLocalizedResource()), + new(ArchiveSplittingSizes.Dvd8128, ToSizeText(8128), Strings.DVD.GetLocalizedResource()), + new(ArchiveSplittingSizes.Bd23040, ToSizeText(23040), Strings.Bluray.GetLocalizedResource()), ]; public DialogViewModel() diff --git a/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs b/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs index e370600b1f9c..1f52db5576dc 100644 --- a/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs +++ b/src/Files.App/Dialogs/ReorderSidebarItemsDialog.xaml.cs @@ -79,7 +79,7 @@ private void DragOver_SetCaptions(LocationItem senderLocationItem, LocationItem else { e.DragUIOverride.IsCaptionVisible = true; - e.DragUIOverride.Caption = "MoveItemsDialogPrimaryButtonText".GetLocalizedResource(); + e.DragUIOverride.Caption = Strings.MoveItemsDialogPrimaryButtonText.GetLocalizedResource(); e.AcceptedOperation = DataPackageOperation.Move; } } diff --git a/src/Files.App/UserControls/TabBar/TabBar.xaml.cs b/src/Files.App/UserControls/TabBar/TabBar.xaml.cs index 17cfc3a5b84a..c1163e066c12 100644 --- a/src/Files.App/UserControls/TabBar/TabBar.xaml.cs +++ b/src/Files.App/UserControls/TabBar/TabBar.xaml.cs @@ -163,7 +163,7 @@ private void TabView_TabStripDragOver(object sender, DragEventArgs e) HorizontalTabView.CanReorderTabs = WindowContext.CanDragAndDrop; e.AcceptedOperation = DataPackageOperation.Move; - e.DragUIOverride.Caption = "TabStripDragAndDropUIOverrideCaption".GetLocalizedResource(); + e.DragUIOverride.Caption = Strings.TabStripDragAndDropUIOverrideCaption.GetLocalizedResource(); e.DragUIOverride.IsCaptionVisible = true; e.DragUIOverride.IsGlyphVisible = false; } @@ -333,7 +333,7 @@ private async void TabBarAddNewTabButton_DragOver(object sender, DragEventArgs e e.Handled = true; var deferral = e.GetDeferral(); e.DragUIOverride.IsCaptionVisible = true; - e.DragUIOverride.Caption = string.Format("OpenInNewTab".GetLocalizedResource()); + e.DragUIOverride.Caption = string.Format(Strings.OpenInNewTab.GetLocalizedResource()); e.AcceptedOperation = DataPackageOperation.Link; deferral.Complete(); } diff --git a/src/Files.App/Views/HomePage.xaml.cs b/src/Files.App/Views/HomePage.xaml.cs index 95be5630bfca..727830f391c5 100644 --- a/src/Files.App/Views/HomePage.xaml.cs +++ b/src/Files.App/Views/HomePage.xaml.cs @@ -57,7 +57,7 @@ protected override async void OnNavigatedTo(NavigationEventArgs e) string componentLabel = parameters?.NavPathParam == "Home" - ? "Home".GetLocalizedResource() + ? Strings.Home.GetLocalizedResource() : parameters?.NavPathParam ?? string.Empty; diff --git a/src/Files.App/Views/MainPage.xaml.cs b/src/Files.App/Views/MainPage.xaml.cs index f688d93b9a54..58159d99b191 100644 --- a/src/Files.App/Views/MainPage.xaml.cs +++ b/src/Files.App/Views/MainPage.xaml.cs @@ -64,10 +64,10 @@ private async Task PromptForReviewAsync() { var promptForReviewDialog = new ContentDialog { - Title = "ReviewFiles".ToLocalized(), - Content = "ReviewFilesContent".ToLocalized(), - PrimaryButtonText = "Yes".ToLocalized(), - SecondaryButtonText = "No".ToLocalized() + Title = Strings.ReviewFiles.ToLocalized(), + Content = Strings.ReviewFilesContent.ToLocalized(), + PrimaryButtonText = Strings.Yes.ToLocalized(), + SecondaryButtonText = Strings.No.ToLocalized() }; if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) @@ -95,10 +95,10 @@ private async Task AppRunningAsAdminPromptAsync() { var runningAsAdminPrompt = new ContentDialog { - Title = "FilesRunningAsAdmin".ToLocalized(), - Content = "FilesRunningAsAdminContent".ToLocalized(), - PrimaryButtonText = "Ok".ToLocalized(), - SecondaryButtonText = "DontShowAgain".ToLocalized() + Title = Strings.FilesRunningAsAdmin.ToLocalized(), + Content = Strings.FilesRunningAsAdminContent.ToLocalized(), + PrimaryButtonText = Strings.Ok.ToLocalized(), + SecondaryButtonText = Strings.DontShowAgain.ToLocalized() }; var result = await SetContentDialogRoot(runningAsAdminPrompt).TryShowAsync(); diff --git a/src/Files.App/Views/Shells/BaseShellPage.cs b/src/Files.App/Views/Shells/BaseShellPage.cs index b2631fe7215d..56876d7a1fb8 100644 --- a/src/Files.App/Views/Shells/BaseShellPage.cs +++ b/src/Files.App/Views/Shells/BaseShellPage.cs @@ -233,7 +233,7 @@ protected async void FilesystemViewModel_DirectoryInfoUpdated(object sender, Eve if (ContentPage is null) return; - var directoryItemCountLocalization = "Items".GetLocalizedFormatResource(ShellViewModel.FilesAndFolders.Count); + var directoryItemCountLocalization = Strings.Items.GetLocalizedFormatResource(ShellViewModel.FilesAndFolders.Count); BranchItem? headBranch = headBranch = InstanceViewModel.IsGitRepository ? await GitHelpers.GetRepositoryHead(InstanceViewModel.GitRepositoryPath) @@ -759,7 +759,7 @@ await DispatcherQueue.EnqueueOrInvokeAsync(async () => protected void SelectSidebarItemFromPath(Type incomingSourcePageType = null) { if (incomingSourcePageType == typeof(HomePage) && incomingSourcePageType is not null) - ToolbarViewModel.PathControlDisplayText = "Home".GetLocalizedResource(); + ToolbarViewModel.PathControlDisplayText = Strings.Home.GetLocalizedResource(); } protected void SetLoadingIndicatorForTabs(bool isLoading) diff --git a/src/Files.App/Views/Shells/ModernShellPage.xaml.cs b/src/Files.App/Views/Shells/ModernShellPage.xaml.cs index b534193e3dab..efe1d3701138 100644 --- a/src/Files.App/Views/Shells/ModernShellPage.xaml.cs +++ b/src/Files.App/Views/Shells/ModernShellPage.xaml.cs @@ -45,7 +45,7 @@ public ModernShellPage() : base(new CurrentInstanceViewModel()) ShellViewModel.OnSelectionRequestedEvent += FilesystemViewModel_OnSelectionRequestedEvent; ShellViewModel.GitDirectoryUpdated += FilesystemViewModel_GitDirectoryUpdated; - ToolbarViewModel.PathControlDisplayText = "Home".GetLocalizedResource(); + ToolbarViewModel.PathControlDisplayText = Strings.Home.GetLocalizedResource(); ToolbarViewModel.RefreshWidgetsRequested += ModernShellPage_RefreshWidgetsRequested; _navigationInteractionTracker = new NavigationInteractionTracker(this, BackIcon, ForwardIcon);