From bbad3a3c8722ac9b0973776f8132b860f73f7816 Mon Sep 17 00:00:00 2001 From: "@uni-chiara" <258727@studenti.unimore.it> Date: Fri, 14 May 2021 11:31:14 +0200 Subject: [PATCH] =?UTF-8?q?=C2=96=F0=9F=87=AE=F0=9F=87=B9=20Small=20change?= =?UTF-8?q?s=20to=20translation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nest_frontend/components/providers/GlobalUser.js | 14 +++++++------- .../components/providers/RepositoryEditor.js | 10 +++++----- nest_frontend/contexts/ContextServer.js | 4 ++-- nest_frontend/contexts/ContextTheme.js | 2 +- nest_frontend/contexts/ContextUser.js | 6 +++--- nest_frontend/hooks/useArrayState.js | 4 ++-- nest_frontend/hooks/useRepositoryEditor.js | 2 +- nest_frontend/utils/convertToLocalISODate.js | 2 +- nest_frontend/utils/goToOnSuccess.js | 4 ++-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/nest_frontend/components/providers/GlobalUser.js b/nest_frontend/components/providers/GlobalUser.js index ee099bc..8bbe256 100644 --- a/nest_frontend/components/providers/GlobalUser.js +++ b/nest_frontend/components/providers/GlobalUser.js @@ -28,7 +28,7 @@ export default function GlobalUser({ children }) { */ const fetchDataAuth = useCallback(async (method, path, body, init) => { if(!user) { - throw new Error("Not logged in") + throw new Error("Non effettuato l'accesso") } if(!init) { @@ -50,13 +50,13 @@ export default function GlobalUser({ children }) { * @returns {Promise} */ const login = useCallback(async (email, password) => { - console.debug("Contacting server to login...") + console.debug("Contattando il server per accedere...") const data = await fetchData("POST", `/api/v1/login`, { "email": email, "password": password, }) - console.debug("Storing login state...") + console.debug("Memorizzando lo stato di login...") setUser({ email: data["user"]["email"], isAdmin: data["user"]["isAdmin"], @@ -64,18 +64,18 @@ export default function GlobalUser({ children }) { token: data["access_token"], }) - console.info("Login successful!") + console.info("Accesso effettuato!") }, [fetchData, setUser]) /** * Logout from the currently active server. */ const logout = useCallback(() => { - console.debug("Clearing login state...") + console.debug("Ripulendo lo stato di login...") setUser(null) - console.debug("Cleared login state!") + console.debug("Stato di login ripulito!") - console.info("Logout successful!") + console.info("Logout avvenuto con successo!") }, [setUser]) return ( diff --git a/nest_frontend/components/providers/RepositoryEditor.js b/nest_frontend/components/providers/RepositoryEditor.js index 9c7bff5..51b940b 100644 --- a/nest_frontend/components/providers/RepositoryEditor.js +++ b/nest_frontend/components/providers/RepositoryEditor.js @@ -71,10 +71,10 @@ export default function RepositoryEditor({ const save = useCallback( async () => { if(!id) { - console.info("Creating new repository with body: ", body) + console.info("Creando una nuova repository avente come corpo: ", body) } else { - console.info("Editing repository ", id, " with body: ", body) + console.info("Modificando la repository ", id, " con corpo: ", body) } await fetchNow() }, @@ -104,7 +104,7 @@ export default function RepositoryEditor({ (newCond) => { // Check for content if(!newCond.content) { - console.debug("Refusing to add ", newCond, ": content is empty.") + console.debug("Impossibile aggiungere ", newCond, ": l'oggetto è vuoto.") return } @@ -117,11 +117,11 @@ export default function RepositoryEditor({ } } if(duplicate) { - console.debug("Refusing to add ", newCond, ": ", duplicate, " already exists.") + console.debug("Impossibile aggiungere ", newCond, ": ", duplicate, " è già esistente.") return } - console.debug("Adding ", newCond, " to the Repository Conditions") + console.debug("Aggiungendo ", newCond, " alle condizioni del repository") appendRawCondition(newCond) }, [_conditions, appendRawCondition], diff --git a/nest_frontend/contexts/ContextServer.js b/nest_frontend/contexts/ContextServer.js index c9a8402..1ca8cd6 100644 --- a/nest_frontend/contexts/ContextServer.js +++ b/nest_frontend/contexts/ContextServer.js @@ -16,7 +16,7 @@ import { createContext } from "react" */ const ContextServer = createContext({ server: null, - setServer: () => console.error("Trying to setServer while outside a ContextServer.Provider!"), - fetchData: () => console.error("Trying to fetchData while outside a ContextServer.Provider!"), + setServer: () => console.error("Provato ad eseguire setServer mentre fuori da un ContextServer.Provider!"), + fetchData: () => console.error("Provato ad eseguire fetchData mentre fuori da un ContextServer.Provider!"), }) export default ContextServer diff --git a/nest_frontend/contexts/ContextTheme.js b/nest_frontend/contexts/ContextTheme.js index 85f9a6b..3b2938f 100644 --- a/nest_frontend/contexts/ContextTheme.js +++ b/nest_frontend/contexts/ContextTheme.js @@ -14,6 +14,6 @@ import { createContext } from "react" const ContextTheme = createContext({ isSet: false, theme: "ThemeDark", - setTheme: () => console.error("Trying to setTheme while outside a ContextTheme.Provider!"), + setTheme: () => console.error("Provato a eseguire setTheme mentre fuori da un ContextTheme.Provider!"), }) export default ContextTheme diff --git a/nest_frontend/contexts/ContextUser.js b/nest_frontend/contexts/ContextUser.js index 9a883c5..f80e44f 100644 --- a/nest_frontend/contexts/ContextUser.js +++ b/nest_frontend/contexts/ContextUser.js @@ -19,8 +19,8 @@ import { createContext } from "react" */ const ContextUser = createContext({ user: null, - login: () => console.error("Trying to login while outside a ContextUser.Provider!"), - logout: () => console.error("Trying to logout while outside a ContextUser.Provider!"), - fetchDataAuth: () => console.error("Trying to fetchDataAuth while outside a ContextUser.Provider!"), + login: () => console.error("Provato ad eseguire l'accesso mentre fuori da un ContextUser.Provider!"), + logout: () => console.error("Provato ad eseguire il logout mentre fuori da un while outside a ContextUser.Provider!"), + fetchDataAuth: () => console.error("Provato ad eseguire fetchDataAuth mentre fuori da un ContextUser.Provider!"), }) export default ContextUser diff --git a/nest_frontend/hooks/useArrayState.js b/nest_frontend/hooks/useArrayState.js index e150ef3..9a8225c 100644 --- a/nest_frontend/hooks/useArrayState.js +++ b/nest_frontend/hooks/useArrayState.js @@ -12,7 +12,7 @@ export default function useArrayState(def) { const appendValue = useCallback( newSingle => { - console.debug("Appending ", newSingle, " to ArrayState") + console.debug("Aggiungendo ", newSingle, " ad ArrayState") setValue( oldArray => [...oldArray, newSingle], ) @@ -22,7 +22,7 @@ export default function useArrayState(def) { const spliceValue = useCallback( position => { - console.debug("Splicing ", position, " from ArrayState") + console.debug("Estraendo ", position, " da ArrayState") setValue( oldArray => { oldArray.splice(position, 1) diff --git a/nest_frontend/hooks/useRepositoryEditor.js b/nest_frontend/hooks/useRepositoryEditor.js index 387ad3b..91d8325 100644 --- a/nest_frontend/hooks/useRepositoryEditor.js +++ b/nest_frontend/hooks/useRepositoryEditor.js @@ -8,7 +8,7 @@ import ContextRepositoryEditor from "../contexts/ContextRepositoryEditor" export default function useRepositoryEditor() { const context = useContext(ContextRepositoryEditor) if(!context) { - throw new Error("This component must be placed inside a RepositoryEditor.") + throw new Error("Questo componente deve essere messo in un RepositoryEditor.") } return context } \ No newline at end of file diff --git a/nest_frontend/utils/convertToLocalISODate.js b/nest_frontend/utils/convertToLocalISODate.js index 16ad738..8282621 100644 --- a/nest_frontend/utils/convertToLocalISODate.js +++ b/nest_frontend/utils/convertToLocalISODate.js @@ -10,7 +10,7 @@ */ export default function convertToLocalISODate(date) { if(date.toString() === "Invalid Date") { - throw new Error("Received an Invalid Date as parameter.") + throw new Error("Data non valida ricevuta come parametro.") } // Create a timezone naive ISO string diff --git a/nest_frontend/utils/goToOnSuccess.js b/nest_frontend/utils/goToOnSuccess.js index 282fee5..23388c0 100644 --- a/nest_frontend/utils/goToOnSuccess.js +++ b/nest_frontend/utils/goToOnSuccess.js @@ -10,13 +10,13 @@ export default function goToOnSuccess(func, history, destination) { return (...args) => { let result try { - console.debug("Trying to run: ", func) + console.debug("Provando ad eseguire: ", func) result = func(...args) history.push(destination) return result } catch(e) { - console.debug("Failed to run ", func, ", not doing anything.") + console.debug("Esecuzione fallita: ", func, ", non ha fatto nulla.") throw e } }