> For the complete documentation index, see [llms.txt](https://docs.i18nifty.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.i18nifty.dev/api-reference/uselang.md).

# useLang

```tsx
//This is the custom useLang, generated and exported by 
//you sin the src/i18n.tsx filed.
import { useLang } from "i18n";

function MyComponent(){

    const { lang, setLang } = useLang();
      
    return (
        <>
            <span>The app is currently in {(()=>{
                switch(lang){
                    case "en": return "English";
                    case "fr": return "French";
                }
            })()}</span>
            <button onClick={()=> setLang("en")}>Put the app in English</button>
            <button onClick={()=> setLang("fr")}>Put the app in French</button>
        </>
    );
    
}


```
