javascript - 无法生成翻译文件 FormatJS
问题描述
我无法生成翻译文件。有人可以帮忙吗?
const NTTracker = () => {
const intl = useIntl()
return (
<>
<FormattedMessage
description="A message"
defaultMessage="Index page, nothing here"
/>
当我跑的时候
npm run extract -- 'src/**/*.js*' --out-file lang/en.json --id-interpolation-pattern '[sha512:contenthash:base64:6]'
输出lang/en.json
只有{}
.
由于我一直在关注文档,因此我无法完全弄清楚问题所在。我的文件结构如下:
|-- src
|-- nttracker
|-- dom.js (the file with <FormattedMessage/>
|-- lang
|-- en.json
|-- package.json
提前致谢。
解决方案
推荐阅读
- php - SQLSTATE[23000]:违反完整性约束:密钥 qr_codes_encoded_key_unique 的重复条目“B”
- javascript - 如何拆分int每两位并插入数组
- sql-server - 我想用盐对这个密码进行哈希处理,但它没有给我相同的答案,我直接对其进行哈希处理
- angular - 有没有可能根据以下情况在 *ngFor 上应用动态 css?
- bash - Bash script variable not being passed via ssh
- c# - NavigationView SetCheckedItem 不会触发 OnNavigationItemSelected
- python-3.x - 乌龟中是否有任何命令可以阻止乌龟进一步绘图?
- python - Error: 'NoneType' object has no attribute 'find_all' for .find
- c# - 如何部署项目中包含 sqlite 数据库的 Outlook 插件?
- ios - 如何在 iOS 13 中支持低数据模式?