1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-12-01 17:04:19 +00:00
pds-2021-g2-nest/nest_frontend/contexts/ContextLanguage.js

15 lines
486 B
JavaScript
Raw Normal View History

2021-05-18 00:04:06 +00:00
import { createContext } from "react"
/**
* A context containing an object with the following values:
* - `lang`: a string corresponding to the ISO 639-1 code of the current language
* - `setLang`: a function to change the current language
* - `strings`: an object containing all strings of the current language
*/
export default createContext({
lang: null,
setLang: () => console.error("Trying to setLang while outside a ContextServer.Provider!"),
strings: null,
})