Ruby on Rails flash messages in French

谁说我不能喝 提交于 2019-12-22 18:21:20

问题


Working on a rails app in French, however whenever i include an accent on the flash messages it breaks the site.

For example

format.html {redirect_to @message.annonce, notice:"Votre message a été envoyé"}
format.html {redirect_to @message.annonce, notice:"Votre email n'a pas pu être envoyer à cause d'une erreur."}

my config/application.rb looks like this

 config.i18n.default_locale = :fr
 config.encoding = "utf-8"

How does one do about this?


回答1:


You should add # encoding: UTF-8 as the first line of your file to add accent in it.

If this is not working please give us the exception raised.



来源:https://stackoverflow.com/questions/13413441/ruby-on-rails-flash-messages-in-french

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!