🚧 Rspress 2.0 document is under development
close

useLang

useLang returns the current locale code so you can render language-specific content or route users accordingly.

  • Type: () => string

The hook reads the active language from the runtime context and stays in sync when users switch locales.