How to use the react-intl-universal.getInitOptions function in react-intl-universal

To help you get started, we’ve selected a few react-intl-universal 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 pythonkr / pyconkr-web / utils / formatDate.ts View on Github external
export const formatDate = (formatTemplate: string) => (date: DateDTO) => {
  if (!date) {
    return '-'
  }
  const localeKey = intl.getInitOptions().currentLocale!

  return formatToTimeZone(date, formatTemplate, {
    // No type interface..(https://github.com/prantlf/date-fns-timezone/issues/10)
    locale: locales[localeKey],
    timeZone: 'Asia/Seoul'
  })
}
github pythonkr / pyconkr-web / lib / apollo_graphql / client.ts View on Github external
const acceptLanguageLink = setContext((_, { headers }) => {
  const locale = intl.getInitOptions().currentLocale

  return {
    headers: {
      ...headers,
      'Accept-Language': locale
    }
  }
})

react-intl-universal

Internationalize React apps. Not only for React component but also for Vanilla JS.

BSD-3-Clause
Latest version published 6 days ago

Package Health Score

71 / 100
Full package analysis