简体   繁体   English

rails国际化撇号

[英]rails internationalization apostrophe

I have a file config/locales/events.en.yml: 我有一个文件config / locales / events.en.yml:

en:
  im_going: im going

And I would like it to be 我希望它是

en:
  im_going: i'm going

But when I do this I get several errors in random parts of code. 但是当我这样做时,我会在代码的随机部分中出现几个错误。 Does anybody know how to internationalizate a string with apostrophe? 有人知道如何使用撇号对字符串进行国际化吗?

Thanks in advance, alex 谢谢你,亚历克斯

This is one of those little things that have always annoyed me about YML. 这是一直让我对YML感到恼火的小事之一。 Anyway, quote your string and everything should be okay: 无论如何,引用你的字符串,一切都应该没问题:

en:
  im_going: "i'm going"

Hope that helps! 希望有所帮助!

From here: http://yaml.org/spec/current.html#id2534365 从这里:http: //yaml.org/spec/current.html#id2534365

en:
  im_going: 'i''m going'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM