Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 devise gem 在我的 Ruby On Rails 应用程序中实现身份验证。有时会显示错误消息,例如:
禁止从该用户保存健康错误:密码太短(最少 6 个字符)
将这些信息翻译成另一种语言的最佳方式是什么?
转到config/locales并复制devise.en.yml,为文件命名,如 devise.other_language_initials.yml。然后添加您自己的翻译。
config/locales
devise.en.yml
有关如何翻译您的申请的更多信息,请访问此处。
最快的方法是将翻译文件下载为您想要的语言。您可以在此链接中找到更多信息。
你会发现有一堆不同语言的文件,用于设计 Flash 通知,你可以在config/locales下下载并添加到你的应用程序中。
希望对你有帮助!:)