在Play Framework
中,messages
文件用于本地化。我已经在其中添加了以下键值,但该值中的单引号没有被选择。
error.incorrectTag = The specified tag doesn't exist in the system
当我使用以下代码打印以上消息时
println(s"${messagesApi("error.incorrectTag")(langs.availables(0))}")
我看到了The specified tag doesnt exist in the system
(没有单引号)
如何打印单引号?
答案 0 :(得分:0)
您需要使用双引号'
来对单引号''
进行转义,如下所示:
error.incorrectTag = The specified tag doesn''t exist in the system