Skip to content
Open
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
2 changes: 2 additions & 0 deletions client/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -2718,6 +2718,7 @@
},
"fileViewers": {
"openWithDefault": "Open with default app",
"cancel": "Cancel",
"details": "Details",
"copyLink": "Copy link",
"openInEditor": "Edit",
Expand All @@ -2736,6 +2737,7 @@
},
"informationEditDownload": "If you want to edit this file, you can download it and open it locally on your device.",
"informationPreviewDownload": "If you want to preview this file, you can download it and open it locally on your device.",
"informationPreviewDefaultApp": "If you want to preview this file, you can open it with your system default application.",
"unknownFileExtension": "This file type extension could not be identified. Please check that it's correctly written (.txt, .pdf, .doc, etc.).",
"noContentFileType": "Could not open this file in the Parsec editor as its type could not be identified.",
"noFolderPreview": "Cannot preview folders.",
Expand Down
4 changes: 3 additions & 1 deletion client/src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -2717,6 +2717,7 @@
},
"fileViewers": {
"openWithDefault": "Ouvrir avec l'app par défaut",
"cancel": "Annuler",
"details": "Détails",
"copyLink": "Copier le lien",
"openInEditor": "Éditer",
Expand All @@ -2734,7 +2735,8 @@
"editionNotAvailable": "L'édition de documents n'est pas disponible"
},
"informationEditDownload": "Si vous souhaitez modifier ce fichier, vous pouvez le télécharger et l'ouvrir localement sur votre appareil.",
"informationPreviewDownload": "Si vous souhaitez prévisualiser ce fichier, vous pouvez le faire dans Parsec ou le télécharger pour l'ouvrir localement sur votre appareil.",
"informationPreviewDownload": "Si vous souhaitez prévisualiser ce fichier, vous pouvez le télécharger pour l'ouvrir localement sur votre appareil.",
"informationPreviewDefaultApp": "Si vous souhaitez visualiser ce fichier, vous pouvez l'ouvrir dans l'application par défaut de votre système.",
"unknownFileExtension": "L'extension de ce fichier n'a pas pu être reconnue. Veuillez vérifier qu'elle est correctement écrite (.txt, .pdf, .doc, etc.).",
"noContentFileType": "Impossible d'ouvrir ce fichier, son type n'ayant pas pu être reconnu dans l'éditeur de Parsec.",
"noFolderPreview": "Impossible d'afficher l'aperçu d'un dossier.",
Expand Down
18 changes: 15 additions & 3 deletions client/src/services/pathOpener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Information, InformationLevel, InformationManager, PresentationMode } f
import { recentDocumentManager } from '@/services/recentDocuments';
import { FileHandlerMode } from '@/views/files/handler';
import { DateTime } from 'luxon';
import { Base64 } from 'megashark-lib';
import { Answer, askQuestion, Base64 } from 'megashark-lib';
import { Ref, ref } from 'vue';

const currentlyOpening = ref(false);
Expand Down Expand Up @@ -252,7 +252,13 @@ async function openPath(
if (contentType.type === FileContentType.Unknown) {
// Couldn't detect the file type, try with the system if allowed/available, otherwise display a message
if (isDesktop() && !options.disallowSystem) {
await _openWithSystem(workspaceHandle, entry, informationManager);
const answer = await askQuestion('fileViewers.errors.titles.unsupportedFileType', 'fileViewers.errors.informationPreviewDefaultApp', {
yesText: 'fileViewers.openWithDefault',
noText: 'fileViewers.cancel',
});
if (answer === Answer.Yes) {
await _openWithSystem(workspaceHandle, entry, informationManager);
}
} else {
await informationManager.present(
new Information({
Expand All @@ -269,7 +275,13 @@ async function openPath(
if ((entry as any).size > OPEN_FILE_SIZE_LIMIT) {
// Too big to open, display try with the system if allowed/available, otherwise display a message
if (isDesktop() && !options.disallowSystem) {
await _openWithSystem(workspaceHandle, entry, informationManager);
const answer = await askQuestion('fileViewers.errors.titles.fileTooBig', 'fileViewers.errors.informationPreviewDefaultApp', {
yesText: 'fileViewers.openWithDefault',
noText: 'fileViewers.cancel',
});
if (answer === Answer.Yes) {
await _openWithSystem(workspaceHandle, entry, informationManager);
}
} else {
await informationManager.present(
new Information({
Expand Down
Loading