How to use single quotes in i18n in Playframework2?

我怕爱的太早我们不能终老 提交于 2020-01-01 09:07:10

问题


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.

So here is an extract of my messages.fr-FR file :

some.key=C'est la vie!

And here is the output :

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!"

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!

回答1:


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

some.key=C''est la vie!


来源:https://stackoverflow.com/questions/12070093/how-to-use-single-quotes-in-i18n-in-playframework2

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