Skip to content

Commit 3572d39

Browse files
authored
Added strings for the share dialog (#1758)
1 parent 1259c2c commit 3572d39

20 files changed

+296
-6
lines changed

Files.Launcher/FolderNames.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+


Files/BaseLayout.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ private async void MenuLayoutItem_Click(object sender, RoutedEventArgs e)
324324
public void RightClickItemContextMenu_Opening(object sender, object e)
325325
{
326326
SetShellContextmenu();
327+
if (!DataTransferManager.IsSupported())
328+
{
329+
UnloadMenuFlyoutItemByName("ShareItem");
330+
}
331+
327332
var selectedFileSystemItems = App.CurrentInstance.ContentPage.SelectedItems;
328333

329334
// Find selected items that are not folders

Files/Interacts/Interaction.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -621,17 +621,19 @@ private async void Manager_DataRequested(DataTransferManager sender, DataRequest
621621
{
622622
DataRequestDeferral dataRequestDeferral = args.Request.GetDeferral();
623623
List<IStorageItem> items = new List<IStorageItem>();
624-
625624
DataRequest dataRequest = args.Request;
626-
dataRequest.Data.Properties.Title = "Data Shared From Files";
627-
dataRequest.Data.Properties.Description = "The items you selected will be shared";
628625

629-
foreach (ListedItem item in App.CurrentInstance.ContentPage.SelectedItems)
626+
/*dataRequest.Data.Properties.Title = "Data Shared From Files";
627+
dataRequest.Data.Properties.Description = "The items you selected will be shared";*/
628+
629+
foreach (ListedItem item in CurrentInstance.ContentPage.SelectedItems)
630630
{
631631
if (item.IsShortcutItem)
632632
{
633633
if (item.IsLinkItem)
634634
{
635+
dataRequest.Data.Properties.Title = string.Format(ResourceController.GetTranslation("ShareDialogTitle"), items.First().Name);
636+
dataRequest.Data.Properties.Description = ResourceController.GetTranslation("ShareDialogSingleItemDescription");
635637
dataRequest.Data.SetWebLink(new Uri(((ShortcutItem)item).TargetPath));
636638
dataRequestDeferral.Complete();
637639
return;
@@ -649,12 +651,23 @@ private async void Manager_DataRequested(DataTransferManager sender, DataRequest
649651
}
650652
}
651653

652-
if (items.Count == 0)
654+
if (items.Count == 1)
655+
{
656+
dataRequest.Data.Properties.Title = string.Format(ResourceController.GetTranslation("ShareDialogTitle"), items.First().Name);
657+
dataRequest.Data.Properties.Description = ResourceController.GetTranslation("ShareDialogSingleItemDescription");
658+
}
659+
else if (items.Count == 0)
653660
{
654-
dataRequest.FailWithDisplayText("Could not access file(s) for sharing");
661+
dataRequest.FailWithDisplayText(ResourceController.GetTranslation("ShareDialogFailMessage"));
655662
dataRequestDeferral.Complete();
656663
return;
657664
}
665+
else
666+
{
667+
dataRequest.Data.Properties.Title = string.Format(ResourceController.GetTranslation("ShareDialogTitleMultipleItems"), items.Count,
668+
ResourceController.GetTranslation("ItemsCount.Text"));
669+
dataRequest.Data.Properties.Description = ResourceController.GetTranslation("ShareDialogMultipleItemsDescription");
670+
}
658671

659672
dataRequest.Data.SetStorageItems(items);
660673
dataRequestDeferral.Complete();

Files/MultilingualResources/Files.de-DE.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,22 @@
11391139
<source>Invalid item</source>
11401140
<target state="new">Invalid item</target>
11411141
</trans-unit>
1142+
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
1143+
<source>There's nothing to share right now</source>
1144+
<target state="new">There's nothing to share right now</target>
1145+
</trans-unit>
1146+
<trans-unit id="ShareDialogMultipleItemsDescription" translate="yes" xml:space="preserve">
1147+
<source>The items you've selected will be shared</source>
1148+
<target state="new">The items you've selected will be shared</target>
1149+
</trans-unit>
1150+
<trans-unit id="ShareDialogSingleItemDescription" translate="yes" xml:space="preserve">
1151+
<source>The selected item will be shared</source>
1152+
<target state="new">The selected item will be shared</target>
1153+
</trans-unit>
1154+
<trans-unit id="ShareDialogTitle" translate="yes" xml:space="preserve">
1155+
<source>Sharing {0}</source>
1156+
<target state="new">Sharing {0}</target>
1157+
</trans-unit>
11421158
</group>
11431159
</body>
11441160
</file>

Files/MultilingualResources/Files.es-ES.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,22 @@
11261126
<source>Invalid item</source>
11271127
<target state="new">Invalid item</target>
11281128
</trans-unit>
1129+
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
1130+
<source>There's nothing to share right now</source>
1131+
<target state="new">There's nothing to share right now</target>
1132+
</trans-unit>
1133+
<trans-unit id="ShareDialogMultipleItemsDescription" translate="yes" xml:space="preserve">
1134+
<source>The items you've selected will be shared</source>
1135+
<target state="new">The items you've selected will be shared</target>
1136+
</trans-unit>
1137+
<trans-unit id="ShareDialogSingleItemDescription" translate="yes" xml:space="preserve">
1138+
<source>The selected item will be shared</source>
1139+
<target state="new">The selected item will be shared</target>
1140+
</trans-unit>
1141+
<trans-unit id="ShareDialogTitle" translate="yes" xml:space="preserve">
1142+
<source>Sharing {0}</source>
1143+
<target state="new">Sharing {0}</target>
1144+
</trans-unit>
11291145
</group>
11301146
</body>
11311147
</file>

Files/MultilingualResources/Files.fr-FR.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,22 @@
11321132
<source>Invalid item</source>
11331133
<target state="new">Invalid item</target>
11341134
</trans-unit>
1135+
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
1136+
<source>There's nothing to share right now</source>
1137+
<target state="new">There's nothing to share right now</target>
1138+
</trans-unit>
1139+
<trans-unit id="ShareDialogMultipleItemsDescription" translate="yes" xml:space="preserve">
1140+
<source>The items you've selected will be shared</source>
1141+
<target state="new">The items you've selected will be shared</target>
1142+
</trans-unit>
1143+
<trans-unit id="ShareDialogSingleItemDescription" translate="yes" xml:space="preserve">
1144+
<source>The selected item will be shared</source>
1145+
<target state="new">The selected item will be shared</target>
1146+
</trans-unit>
1147+
<trans-unit id="ShareDialogTitle" translate="yes" xml:space="preserve">
1148+
<source>Sharing {0}</source>
1149+
<target state="new">Sharing {0}</target>
1150+
</trans-unit>
11351151
</group>
11361152
</body>
11371153
</file>

Files/MultilingualResources/Files.he-IL.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,22 @@
11281128
<source>Invalid item</source>
11291129
<target state="new">Invalid item</target>
11301130
</trans-unit>
1131+
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
1132+
<source>There's nothing to share right now</source>
1133+
<target state="new">There's nothing to share right now</target>
1134+
</trans-unit>
1135+
<trans-unit id="ShareDialogMultipleItemsDescription" translate="yes" xml:space="preserve">
1136+
<source>The items you've selected will be shared</source>
1137+
<target state="new">The items you've selected will be shared</target>
1138+
</trans-unit>
1139+
<trans-unit id="ShareDialogSingleItemDescription" translate="yes" xml:space="preserve">
1140+
<source>The selected item will be shared</source>
1141+
<target state="new">The selected item will be shared</target>
1142+
</trans-unit>
1143+
<trans-unit id="ShareDialogTitle" translate="yes" xml:space="preserve">
1144+
<source>Sharing {0}</source>
1145+
<target state="new">Sharing {0}</target>
1146+
</trans-unit>
11311147
</group>
11321148
</body>
11331149
</file>

Files/MultilingualResources/Files.hi-IN.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,22 @@
11291129
<source>Invalid item</source>
11301130
<target state="new">Invalid item</target>
11311131
</trans-unit>
1132+
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
1133+
<source>There's nothing to share right now</source>
1134+
<target state="new">There's nothing to share right now</target>
1135+
</trans-unit>
1136+
<trans-unit id="ShareDialogMultipleItemsDescription" translate="yes" xml:space="preserve">
1137+
<source>The items you've selected will be shared</source>
1138+
<target state="new">The items you've selected will be shared</target>
1139+
</trans-unit>
1140+
<trans-unit id="ShareDialogSingleItemDescription" translate="yes" xml:space="preserve">
1141+
<source>The selected item will be shared</source>
1142+
<target state="new">The selected item will be shared</target>
1143+
</trans-unit>
1144+
<trans-unit id="ShareDialogTitle" translate="yes" xml:space="preserve">
1145+
<source>Sharing {0}</source>
1146+
<target state="new">Sharing {0}</target>
1147+
</trans-unit>
11321148
</group>
11331149
</body>
11341150
</file>

Files/MultilingualResources/Files.it-IT.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,22 @@
11281128
<source>Invalid item</source>
11291129
<target state="translated">Elemento non valido</target>
11301130
</trans-unit>
1131+
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
1132+
<source>There's nothing to share right now</source>
1133+
<target state="new">There's nothing to share right now</target>
1134+
</trans-unit>
1135+
<trans-unit id="ShareDialogMultipleItemsDescription" translate="yes" xml:space="preserve">
1136+
<source>The items you've selected will be shared</source>
1137+
<target state="new">The items you've selected will be shared</target>
1138+
</trans-unit>
1139+
<trans-unit id="ShareDialogSingleItemDescription" translate="yes" xml:space="preserve">
1140+
<source>The selected item will be shared</source>
1141+
<target state="new">The selected item will be shared</target>
1142+
</trans-unit>
1143+
<trans-unit id="ShareDialogTitle" translate="yes" xml:space="preserve">
1144+
<source>Sharing {0}</source>
1145+
<target state="new">Sharing {0}</target>
1146+
</trans-unit>
11311147
</group>
11321148
</body>
11331149
</file>

Files/MultilingualResources/Files.ja-JP.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,22 @@
11321132
<source>Invalid item</source>
11331133
<target state="new">Invalid item</target>
11341134
</trans-unit>
1135+
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
1136+
<source>There's nothing to share right now</source>
1137+
<target state="new">There's nothing to share right now</target>
1138+
</trans-unit>
1139+
<trans-unit id="ShareDialogMultipleItemsDescription" translate="yes" xml:space="preserve">
1140+
<source>The items you've selected will be shared</source>
1141+
<target state="new">The items you've selected will be shared</target>
1142+
</trans-unit>
1143+
<trans-unit id="ShareDialogSingleItemDescription" translate="yes" xml:space="preserve">
1144+
<source>The selected item will be shared</source>
1145+
<target state="new">The selected item will be shared</target>
1146+
</trans-unit>
1147+
<trans-unit id="ShareDialogTitle" translate="yes" xml:space="preserve">
1148+
<source>Sharing {0}</source>
1149+
<target state="new">Sharing {0}</target>
1150+
</trans-unit>
11351151
</group>
11361152
</body>
11371153
</file>

0 commit comments

Comments
 (0)