在yaml中写#(在字符串中) [英] Write # in yaml (in the string)

查看:482
本文介绍了在yaml中写#(在字符串中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用yml文件的新手(用于我的框架中的翻译)。

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

我正在尝试在翻译内容中添加#(推特分享... blabla)。

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...

推荐答案

只需将值放在单引号或双引号中,就不会将其视为注释。

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

en:
  twitter:
    share: "#hashtag"

这篇关于在yaml中写#(在字符串中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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