Skip to content

Commit e449866

Browse files
authored
Fixed an issue where the tab title was missing in the documents library (#8107)
1 parent eae8230 commit e449866

File tree

4 files changed

+18
-41
lines changed

4 files changed

+18
-41
lines changed

src/Files/Strings/en-US/Resources.resw

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<root>
33
<!--
44
Microsoft ResX Schema
@@ -267,21 +267,9 @@
267267
<data name="Downloads" xml:space="preserve">
268268
<value>Downloads</value>
269269
</data>
270-
<data name="SidebarHome" xml:space="preserve">
271-
<value>Home</value>
272-
</data>
273-
<data name="SidebarMusic" xml:space="preserve">
274-
<value>Music</value>
275-
</data>
276-
<data name="SidebarPictures" xml:space="preserve">
277-
<value>Pictures</value>
278-
</data>
279270
<data name="SideBarUnpinFromFavorites.Text" xml:space="preserve">
280271
<value>Unpin from Favorites</value>
281272
</data>
282-
<data name="SidebarVideos" xml:space="preserve">
283-
<value>Videos</value>
284-
</data>
285273
<data name="BaseLayoutContextFlyoutSortBy.Text" xml:space="preserve">
286274
<value>Sort by</value>
287275
</data>
@@ -2744,6 +2732,15 @@ We use App Center to track which settings are being used, find bugs, and fix cra
27442732
<data name="CloseOtherTabs" xml:space="preserve">
27452733
<value>Close other tabs</value>
27462734
</data>
2735+
<data name="Music" xml:space="preserve">
2736+
<value>Music</value>
2737+
</data>
2738+
<data name="Pictures" xml:space="preserve">
2739+
<value>Pictures</value>
2740+
</data>
2741+
<data name="Videos" xml:space="preserve">
2742+
<value>Videos</value>
2743+
</data>
27472744
<data name="UpdateFiles" xml:space="preserve">
27482745
<value>Update Files</value>
27492746
</data>

src/Files/UserControls/Widgets/FolderWidget.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,17 @@ private async void FolderWidget_Loaded(object sender, RoutedEventArgs e)
173173
});
174174
ItemsAdded.Add(new LibraryCardItem
175175
{
176-
Text = "SidebarMusic".GetLocalized(),
176+
Text = "Music".GetLocalized(),
177177
Path = UserDataPaths.GetDefault().Music,
178178
});
179179
ItemsAdded.Add(new LibraryCardItem
180180
{
181-
Text = "SidebarPictures".GetLocalized(),
181+
Text = "Pictures".GetLocalized(),
182182
Path = UserDataPaths.GetDefault().Pictures,
183183
});
184184
ItemsAdded.Add(new LibraryCardItem
185185
{
186-
Text = "SidebarVideos".GetLocalized(),
186+
Text = "Videos".GetLocalized(),
187187
Path = UserDataPaths.GetDefault().Videos,
188188
});
189189

src/Files/ViewModels/MainPageViewModel.cs

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -288,29 +288,9 @@ public static async Task UpdateTabInfo(TabItem tabItem, object navigationArg)
288288
}
289289
else if (App.LibraryManager.TryGetLibrary(currentPath, out LibraryLocationItem library))
290290
{
291-
var libName = System.IO.Path.GetFileNameWithoutExtension(library.Path);
292-
switch (libName)
293-
{
294-
case "Documents":
295-
tabLocationHeader = $"Sidebar{libName}".GetLocalized(); // Show localized name
296-
break;
297-
298-
case "Pictures":
299-
tabLocationHeader = $"Sidebar{libName}".GetLocalized(); // Show localized name
300-
break;
301-
302-
case "Music":
303-
tabLocationHeader = $"Sidebar{libName}".GetLocalized(); // Show localized name
304-
break;
305-
306-
case "Videos":
307-
tabLocationHeader = $"Sidebar{libName}".GetLocalized(); // Show localized name
308-
break;
309-
310-
default:
311-
tabLocationHeader = library.Text; // Show original name
312-
break;
313-
}
291+
var libName = System.IO.Path.GetFileNameWithoutExtension(library.Path).GetLocalized();
292+
// If localized string is empty use the library name.
293+
tabLocationHeader = string.IsNullOrEmpty(libName) ? library.Text : libName;
314294
}
315295
else
316296
{

src/Files/ViewModels/SettingsViewModels/PreferencesViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public PreferencesViewModel()
7171
PagesOnStartupList.CollectionChanged += PagesOnStartupList_CollectionChanged;
7272

7373
var recentsItem = new MenuFlyoutSubItemViewModel("JumpListRecentGroupHeader".GetLocalized());
74-
recentsItem.Items.Add(new MenuFlyoutItemViewModel("SidebarHome".GetLocalized(), "Home".GetLocalized(), AddPageCommand));
74+
recentsItem.Items.Add(new MenuFlyoutItemViewModel("Home".GetLocalized(), "Home".GetLocalized(), AddPageCommand));
7575
PopulateRecentItems(recentsItem).ContinueWith(_ =>
7676
{
7777
AddFlyoutItemsSource = new ReadOnlyCollection<IMenuFlyoutItem>(new IMenuFlyoutItem[] {
@@ -293,7 +293,7 @@ public string Text
293293
{
294294
if (Path == "Home".GetLocalized())
295295
{
296-
return "SidebarHome".GetLocalized();
296+
return "Home".GetLocalized();
297297
}
298298
if (Path == CommonPaths.RecycleBinPath)
299299
{

0 commit comments

Comments
 (0)