Skip to content

Commit

Permalink
Actual fix
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey committed Dec 19, 2024
1 parent 222625a commit aafa64c
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/locale/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// Don't remove -force from these because detection is VERY slow on low-end Android.
// https://github.com/formatjs/formatjs/issues/4463#issuecomment-2176070577
import '@formatjs/intl-locale/polyfill-force'
import '@formatjs/intl-datetimeformat/polyfill-force'
import '@formatjs/intl-pluralrules/polyfill-force'
import '@formatjs/intl-numberformat/polyfill-force'
import '@formatjs/intl-datetimeformat/locale-data/en'
import '@formatjs/intl-pluralrules/locale-data/en'
import '@formatjs/intl-numberformat/locale-data/en'

import {useEffect} from 'react'
import {getCalendars} from 'expo-localization'
import {i18n} from '@lingui/core'

import {sanitizeAppLanguageSetting} from '#/locale/helpers'
Expand Down Expand Up @@ -47,20 +45,6 @@ import {messages as messagesZh_HK} from '#/locale/locales/zh-HK/messages'
import {messages as messagesZh_TW} from '#/locale/locales/zh-TW/messages'
import {useLanguagePrefs} from '#/state/preferences'

/**
* Set default time zone for Intl.DateTimeFormat polyfill from formatjs
* {@link https://formatjs.github.io/docs/polyfills/intl-datetimeformat/#default-timezone}
*
* According to docs, `getCalendars` is guaranteed to have at least one
* calendar, and for now this ONLY returns one calendar.
* {@link https://docs.expo.dev/versions/latest/sdk/localization/#localizationgetcalendars}
*/
if ('__setDefaultTimeZone' in Intl.DateTimeFormat) {
console.log('Setting default time zone', getCalendars()[0].timeZone)
// @ts-ignore
Intl.DateTimeFormat.__setDefaultTimeZone(getCalendars()[0].timeZone)
}

/**
* We do a dynamic import of just the catalog that we need
*/
Expand Down

0 comments on commit aafa64c

Please sign in to comment.