0

我正在尝试使用 react-intl FormattedMessage 组件来匹配带有空格的短语,但由于其中一个键有空格而收到“消息解析失败”错误。

Format.js 选择: https ://formatjs.io/docs/core-concepts/icu-syntax/#select-format

<FormattedMessage
  defaultMessage={`{orderStatus, select,
  Accepted {Accepted}
  Shipped {Shipped}
  Cancelled {Cancelled}
  Shipping Delay {Processing}
  other {Unknown}
}`}
  description="Order status values"
  values={{
    orderStatus,
  }}
/>

如果我删除“运输延迟”行,它工作正常。我已经尝试过正'Shipping Delay'^Shipping\sDelay表达式......没有运气。关于我还能尝试什么的任何线索?

4

0 回答 0