Search code examples
ruby-on-railsrubyinternationalizationapostrophe

rails internationalization apostrophe


I have a file 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


Solution

  • This is one of those little things that have always annoyed me about YML. Anyway, quote your string and everything should be okay:

    en:
      im_going: "i'm going"
    

    Hope that helps!