当Rails函数要求翻译(I18n.translate
)时,我不想分析他们的代码以获得确切的范围等.
如何为每个要求的字符串添加调试输出到控制台?
例子:
I18n.t 'errors.messages.invalid', :scope => :active_record
# Translation for 'activerecord.errors.messages.invalid' (not) found
label(:post, :title)
# Translation for 'activerecord.attributes.post.title' not found
# Translation for 'views.labels.post.title' not found
Run Code Online (Sandbox Code Playgroud) 根据此评论,支持多行变量docker compose
:
environment:
KEY: |-
line1
line2
Run Code Online (Sandbox Code Playgroud)
但是,当我echo $KEY
在容器中执行时,它已用空格替换换行符:
line1 line2
我错过了什么吗?我的码头版本是1.12.1.
我想检查IP是否列入白名单,但是IPv6-地址可以有不同的表示形式:
例如2001:0DB8:0:0:1::1
是2001:0db8:0000:0000:0001:0000:0000:0001
。
因此,字符串比较不起作用。我怎么知道两个地址相等?