- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我想在我的应用程序中重置密码时,我需要根据浏览器的语言更改发送消息的语言。这是我的 onSubmit 函数,我在提交表单时调用它来发送消息。我从状态中获取值(value)并将其放入语言代码中。我用的是 redux
onSubmit = () => {
let error = {}
if (!this.state.email)
error.email = <FormattedMessage id='common.error.empty' />
if (Object.keys(error).length) {
this.setState({error})
return
}
this.props.languageCode(this.props.locale)
this.props.doPasswordReset(this.state.email).then(() => {
this.setState({openDialog: true})
}).catch(error => {
this.setState({
error: {
...this.state.error,
email: error.message,
},
})
})
}
最佳答案
感谢@Frank van Puffelen、@Miyo Alpízar @Frederiko Cesar 在 this question 中的回答& this question
Firebase's error message are targeted at application developers, so are in English only. While we'd love to provide them in the same languages as we provide our documentation in, that will never cover all the languages of your users.
So you will have to detect the error in your code, log the error to a central system where you can inspect the problem and then show a localized error message to your user.
As far as I know there is no standardized way of doing that in Angular. But if there is, it'll be unrelated to Firebase.
关于firebase - 如何更改在 Firebase 身份验证中发送的消息的语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51729482/
我是一名优秀的程序员,十分优秀!