Skip to content

Fixed an issue where the tab title was missing in the documents library #8107

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

Merged
merged 5 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
23 changes: 10 additions & 13 deletions src/Files/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -267,21 +267,9 @@
<data name="Downloads" xml:space="preserve">
<value>Downloads</value>
</data>
<data name="SidebarHome" xml:space="preserve">
<value>Home</value>
</data>
<data name="SidebarMusic" xml:space="preserve">
<value>Music</value>
</data>
<data name="SidebarPictures" xml:space="preserve">
<value>Pictures</value>
</data>
<data name="SideBarUnpinFromFavorites.Text" xml:space="preserve">
<value>Unpin from Favorites</value>
</data>
<data name="SidebarVideos" xml:space="preserve">
<value>Videos</value>
</data>
<data name="BaseLayoutContextFlyoutSortBy.Text" xml:space="preserve">
<value>Sort by</value>
</data>
Expand Down Expand Up @@ -2744,6 +2732,15 @@ We use App Center to track which settings are being used, find bugs, and fix cra
<data name="CloseOtherTabs" xml:space="preserve">
<value>Close other tabs</value>
</data>
<data name="Music" xml:space="preserve">
<value>Music</value>
</data>
<data name="Pictures" xml:space="preserve">
<value>Pictures</value>
</data>
<data name="Videos" xml:space="preserve">
<value>Videos</value>
</data>
<data name="UpdateFiles" xml:space="preserve">
<value>Update Files</value>
</data>
Expand Down
6 changes: 3 additions & 3 deletions src/Files/UserControls/Widgets/FolderWidget.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ private async void FolderWidget_Loaded(object sender, RoutedEventArgs e)
});
ItemsAdded.Add(new LibraryCardItem
{
Text = "SidebarMusic".GetLocalized(),
Text = "Music".GetLocalized(),
Path = UserDataPaths.GetDefault().Music,
});
ItemsAdded.Add(new LibraryCardItem
{
Text = "SidebarPictures".GetLocalized(),
Text = "Pictures".GetLocalized(),
Path = UserDataPaths.GetDefault().Pictures,
});
ItemsAdded.Add(new LibraryCardItem
{
Text = "SidebarVideos".GetLocalized(),
Text = "Videos".GetLocalized(),
Path = UserDataPaths.GetDefault().Videos,
});

Expand Down
26 changes: 3 additions & 23 deletions src/Files/ViewModels/MainPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,29 +288,9 @@ public static async Task UpdateTabInfo(TabItem tabItem, object navigationArg)
}
else if (App.LibraryManager.TryGetLibrary(currentPath, out LibraryLocationItem library))
{
var libName = System.IO.Path.GetFileNameWithoutExtension(library.Path);
switch (libName)
{
case "Documents":
tabLocationHeader = $"Sidebar{libName}".GetLocalized(); // Show localized name
break;

case "Pictures":
tabLocationHeader = $"Sidebar{libName}".GetLocalized(); // Show localized name
break;

case "Music":
tabLocationHeader = $"Sidebar{libName}".GetLocalized(); // Show localized name
break;

case "Videos":
tabLocationHeader = $"Sidebar{libName}".GetLocalized(); // Show localized name
break;

default:
tabLocationHeader = library.Text; // Show original name
break;
}
var libName = System.IO.Path.GetFileNameWithoutExtension(library.Path).GetLocalized();
// If localized string is empty use the library name.
tabLocationHeader = string.IsNullOrEmpty(libName) ? library.Text : libName;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public PreferencesViewModel()
PagesOnStartupList.CollectionChanged += PagesOnStartupList_CollectionChanged;

var recentsItem = new MenuFlyoutSubItemViewModel("JumpListRecentGroupHeader".GetLocalized());
recentsItem.Items.Add(new MenuFlyoutItemViewModel("SidebarHome".GetLocalized(), "Home".GetLocalized(), AddPageCommand));
recentsItem.Items.Add(new MenuFlyoutItemViewModel("Home".GetLocalized(), "Home".GetLocalized(), AddPageCommand));
PopulateRecentItems(recentsItem).ContinueWith(_ =>
{
AddFlyoutItemsSource = new ReadOnlyCollection<IMenuFlyoutItem>(new IMenuFlyoutItem[] {
Expand Down Expand Up @@ -293,7 +293,7 @@ public string Text
{
if (Path == "Home".GetLocalized())
{
return "SidebarHome".GetLocalized();
return "Home".GetLocalized();
}
if (Path == CommonPaths.RecycleBinPath)
{
Expand Down