useGlossary
is a core functionality that provides multilingual copy from a CMS.
The glossary module exports different functions of which only one has to be used: useGlossary
. The other functions are for internal use by the architecture and will not be documented.
Using the glossary couldn't be easier, call the hook and everything else is done automatically:
function Home() {
const glossary = useGlossary();
return <h1>{glossary.title}</h1>;
}
To switch the language you can use <Language />
component provided here.
Last modified | Wednesday, February 3, 2021, 10:17:16 AM UTC |
Last author | Colin van Eenige |
Commit ID | a5fc248 |