如何在Playframework2的i18n中使用单引号? [英] How to use single quotes in i18n in Playframework2?

查看:44
本文介绍了如何在Playframework2的i18n中使用单引号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用法语应用程序时(法语中充满了单引号),我需要使用带单引号的i18n和许多其他突出字符.

While working on a French app (french language is full of single quotes), I needed to use i18n with single quotes and many other accentuated chars.

这是我的messages.fr-FR文件的摘录:

some.key=C'est la vie!

这是输出:

Cest la vie!

如何在邮件中使用包含单引号的字符串?已经尝试过这些:

How can I use strings containing single quotes in my messages? Already tried those :

some.key=C\'est la vie! --> C\est la vie!
some.key="C'est la vie!" --> "Cest la vie!"


编辑:多亏了链接 KDavid ,我才能够找到解决方案.您必须将单引号加倍.


EDIT : Thanks to the link KDavid gave I was able to find the solution. You have to double single-quote.

C''est la vie! --> C'est la vie!

推荐答案

在单引号前加上...单引号(因此,只需使用两个单引号即可):

prefix the single quote with... single quote (so just use two single quotes):

some.key=C''est la vie!

这篇关于如何在Playframework2的i18n中使用单引号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆