Localization
Learn how to display Widgets in multiple languages.
Widgets can automatically translate text in your users’ preferred language, with support for 90 languages out of the box. If your website is already localized in multiple languages, then Widgets can match the page’s language, giving your users a consistent experience.

Dates are also formatted with respect to the user’s locale.
Localization support is provided through a separate @workos-inc/widgets-i18n package. This opt-in approach keeps the core Widgets package lightweight for applications that don’t require multilingual behavior.
Translation dictionaries are loaded lazily, meaning only the language bundle matching the end user’s locale is downloaded at runtime.
Install the package:
Wrap your application with the WorkOsLocaleProvider:
The WorkOsLocaleProvider should wrap your entire application, similar to other context providers. Pass the user’s locale as the locale prop.
Use the utilities exported from @workos-inc/widgets-i18n to detect and validate locales:
getLocaleCodes()– Set of all supported locale codesisValidLocale()– Validates whether a string is a supported locale codegetDir()– Returns the text direction ('ltr'or'rtl') for a locale
Here’s an example on how to detect the user’s locale from the accept-language header in Next.js:
For right-to-left languages like Arabic and Hebrew, set the dir attribute on your HTML element. Use the getDir() function to determine the appropriate text direction:
Widgets will automatically inherit their text direction based on the nearest ancestor’s dir attribute.
Widgets support the same locales as the AuthKit hosted UI. See the AuthKit localization documentation for the full list of supported locale codes.