gpt4 book ai didi

reactjs - 在@formatjs/intl-relativetimeformat/dist/locale-data/中哪里可以找到美国的语言环境

转载 作者:行者123 更新时间:2023-12-03 22:04:40 25 4
gpt4 key购买 nike

我正在将 react-intl 迁移到 3.0 版,并且需要为 IE 填充语言环境数据。具体来说,我想为 en-US 加载区域设置数据的 polyfill。我只能找到@formatjs/intl-relativetimeformat/dist/locale-data/en语言环境文件。

if (!Intl.RelativeTimeFormat) {
// eslint-disable-next-line global-require
require('@formatjs/intl-relativetimeformat/polyfill');
// eslint-disable-next-line global-require
require('@formatjs/intl-relativetimeformat/dist/locale-data/en-US');
}

它导致此错误:
Module not found: Error: Can't resolve '@formatjs/intl-relativetimeformat/dist/locale-data/en-US' in '/xxx/xxx/xxx/xxx/app'

最佳答案

"@formatjs/intl-relativetimeformat": "^7.2.0", 中尝试以下格式

import '@formatjs/intl-pluralrules/polyfill'
import '@formatjs/intl-pluralrules/locale-data/en'
import '@formatjs/intl-pluralrules/locale-data/de'

import '@formatjs/intl-relativetimeformat/polyfill'
import '@formatjs/intl-relativetimeformat/locale-data/en'
import '@formatjs/intl-relativetimeformat/locale-data/de'

addLocaleData尚未根据 https://formatjs.io/docs/react-intl/upgrade-guide-3x/#migrate-to-using-native-intl-apis 删除

关于reactjs - 在@formatjs/intl-relativetimeformat/dist/locale-data/中哪里可以找到美国的语言环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57919842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com