我有一个下拉菜单,其中列出了选项 1、选项 2 和选项 3。我想使用 react-i18next 翻译这些选项。我是翻译和使用这个框架的新手。
下面是代码,
export default class Example extends React.Component {
render() {
return (
<ParentComponent>
<button type="button">
{this.props.placeholder}
</button>
{this.props.values.map(value => (
<Item
key={value[this.props.value_prop]}
value={value}
on_select={this.change}>
{value[this.props.label_prop]} // i want to
translate this
</Item>
))}
</ParentComponent>
);
}
有人可以提供有关如何解决此问题的想法...或帮助我解决此问题。谢谢。