Rails Active Record 翻译:自动大写/小写?
采用默认措辞,在某些情况下,用户模型将显示为“用户”(小写),如“3 个错误禁止保存此用户”,在某些情况下显示为“用户”(大写)(如嵌套中) -型号形式:用户名不能为空)。这应该适用于其他基于拉丁语的语言,对吗?如何指定模型名称翻译,以便 Rails(Active Record?)根据上下文以小写或大写形式显示它(如上所述)?
Taking the default wording it self, in some case, user model will be displayed as 'user' (lowercase) as in "3 errors prohibited this user from being saved" and in some case as 'User' (capitalized) (as in nested-model form: User name can't be blank). That should be applied to other Latin-based language, right? How can I specify a model name translation so that Rails (Active Record?) display it in lowercase or in capitalized depends on the context (as pointed above)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 https://github.com/rails/ Rails/blob/master/activerecord/lib/active_record/locale/en.yml。您的两个疑问都有答案。
See https://github.com/rails/rails/blob/master/activerecord/lib/active_record/locale/en.yml. There are answers for both your doubts.