summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Rodolfi <marco.rodolfi@tuta.io>2023-06-26 08:53:41 +0200
committerMarco Rodolfi <marco.rodolfi@tuta.io>2023-06-26 08:53:41 +0200
commit3e64e53cd724773c4616b178fd695091f9a7c71a (patch)
treeea2d87e2c5b6cac409113842d89c850b848eac1e
parentef9afa8cbca29a3dd83454f44264a4682e968c59 (diff)
downloaddecky-loader-3e64e53cd724773c4616b178fd695091f9a7c71a.tar.gz
decky-loader-3e64e53cd724773c4616b178fd695091f9a7c71a.zip
feat: Added detailed message for permission error and clean up english language from unused strings.
-rw-r--r--backend/locales/en-US.json17
-rw-r--r--backend/locales/it-IT.json1
-rw-r--r--frontend/i18next-parser.config.mjs2
-rw-r--r--frontend/src/components/modals/filepicker/FilePickerError.tsx7
-rw-r--r--frontend/src/components/modals/filepicker/index.tsx3
5 files changed, 17 insertions, 13 deletions
diff --git a/backend/locales/en-US.json b/backend/locales/en-US.json
index 3e24887c..180a8a70 100644
--- a/backend/locales/en-US.json
+++ b/backend/locales/en-US.json
@@ -20,6 +20,7 @@
"FilePickerError": {
"errors": {
"file_not_found": "The path specified is not valid. Please check it and reenter it correctly.",
+ "perm_denied": "You do not have access to the specified directory. Please check if your user (deck on Steam Deck) has the corresponding permission to access the specified folder/file.",
"unknown": "An unknown error occurred. The raw error is: {{raw_error}}"
}
},
@@ -159,10 +160,6 @@
"label_url": "Install Plugin from URL",
"label_zip": "Install Plugin from ZIP File"
},
- "toast_zip": {
- "body": "Installation failed! Only ZIP files are supported.",
- "title": "Decky"
- },
"valve_internal": {
"desc1": "Enables the Valve internal developer menu.",
"desc2": "Do not touch anything in this menu unless you know what it does.",
@@ -178,25 +175,23 @@
"header": "Beta participation"
},
"developer_mode": {
- "desc": "Enables Decky's developer settings.",
"label": "Developer mode"
},
+ "notifications": {
+ "decky_updates_label": "Decky update available",
+ "header": "Notifications",
+ "plugin_updates_label": "Plugin updates available"
+ },
"other": {
"header": "Other"
},
"updates": {
"header": "Updates"
- },
- "notifications": {
- "header": "Notifications",
- "decky_updates_label": "Decky update available",
- "plugin_updates_label": "Plugin updates available"
}
},
"SettingsIndex": {
"developer_title": "Developer",
"general_title": "General",
- "navbar_settings": "Decky Settings",
"plugins_title": "Plugins"
},
"Store": {
diff --git a/backend/locales/it-IT.json b/backend/locales/it-IT.json
index 61033158..7a041257 100644
--- a/backend/locales/it-IT.json
+++ b/backend/locales/it-IT.json
@@ -20,6 +20,7 @@
"FilePickerError": {
"errors": {
"file_not_found": "Il percorso specificato non è valido. Controllalo e prova a reinserirlo di nuovo.",
+ "perm_denied": "Il tuo utente (deck su Steam Deck) non ha accesso al percorso specificato. Controlla che abbia i permessi corrispondenti per accedere alla cartella/file desiderato.",
"unknown": "È avvenuto un'errore sconosciuto. L'errore segnalato è {{raw_error}}"
}
},
diff --git a/frontend/i18next-parser.config.mjs b/frontend/i18next-parser.config.mjs
index 9d4b114d..8de58cfc 100644
--- a/frontend/i18next-parser.config.mjs
+++ b/frontend/i18next-parser.config.mjs
@@ -36,7 +36,7 @@ export default {
lineEnding: 'auto',
// Control the line ending. See options at https://github.com/ryanve/eol
- locales: ['en-US', 'it-IT'],
+ locales: ['en-US'],
// An array of the locales in your applications
namespaceSeparator: false,
diff --git a/frontend/src/components/modals/filepicker/FilePickerError.tsx b/frontend/src/components/modals/filepicker/FilePickerError.tsx
index bf75afae..f2330b9a 100644
--- a/frontend/src/components/modals/filepicker/FilePickerError.tsx
+++ b/frontend/src/components/modals/filepicker/FilePickerError.tsx
@@ -1,10 +1,11 @@
import { FC, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { IconContext } from 'react-icons';
-import { FaExclamationTriangle, FaQuestionCircle } from 'react-icons/fa';
+import { FaExclamationTriangle, FaQuestionCircle, FaUserSlash } from 'react-icons/fa';
export enum FileErrorTypes {
FileNotFound,
+ PermissionDenied,
Unknown,
None,
}
@@ -25,6 +26,10 @@ const FilePickerError: FC<FilePickerErrorProps> = ({ error, rawError = null }) =
setText(t('FilePickerError.errors.file_not_found'));
setIcon(<FaExclamationTriangle />);
break;
+ case FileErrorTypes.PermissionDenied:
+ setText(t('FilePickerError.errors.perm_denied'));
+ setIcon(<FaUserSlash />);
+ break;
case FileErrorTypes.Unknown:
setText(t('FilePickerError.errors.unknown', { raw_error: rawError }));
setIcon(<FaQuestionCircle />);
diff --git a/frontend/src/components/modals/filepicker/index.tsx b/frontend/src/components/modals/filepicker/index.tsx
index 50931358..ae745c9c 100644
--- a/frontend/src/components/modals/filepicker/index.tsx
+++ b/frontend/src/components/modals/filepicker/index.tsx
@@ -210,6 +210,9 @@ const FilePicker: FunctionComponent<FilePickerProps> = ({
case theError.match(/\[WinError\s3.*/i)?.input:
setError(FileErrorTypes.FileNotFound);
break;
+ case theError.match(/\[Errno\s13.*/i)?.input:
+ setError(FileErrorTypes.PermissionDenied);
+ break;
default:
setRawError(theError);
setError(FileErrorTypes.Unknown);