Write # in yaml (in the string)

2020-08-09 08:01发布

问题:

I'm new using yml files (for translations in my framework).

I'm trying to add a "#" inside the translation (will be a twitter share... blabla).

Is this possible, because the file translate it like a comment...

回答1:

Just put the value inside single or double quotes and it won't be treated like a comment. Something like:

en:
  twitter:
    share: "#hashtag"