How to use the decentraland-dapps/dist/modules/translation/actions.changeLocale function in decentraland-dapps

To help you get started, we’ve selected a few decentraland-dapps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github decentraland / builder / src / modules / translation / sagas.ts View on Github external
function* handleStorageLoad() {
  const currentLocale = yield select(getLocale)

  const urlParams = new URLSearchParams(window.location.search)
  const locale = urlParams.get('locale')
  const locales = Object.keys(languages)

  if (locale && locale !== currentLocale && locales.includes(locale)) {
    yield put(changeLocale(locale as Locale))
  }
}