1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

–🇮🇹 Small changes to translation

This commit is contained in:
@uni-chiara 2021-05-14 11:31:14 +02:00
parent ff8d6290b8
commit bbad3a3c87
9 changed files with 24 additions and 24 deletions

View file

@ -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<void>}
*/
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 (

View file

@ -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],

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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
}

View file

@ -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

View file

@ -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
}
}