Is there a way to have my en.yml file contain a constant?
# en.yml
foo:
bar:
I love BAZ so much!
# initializers/constants.rb
BAZ = "stackoverflow.com"
I18n.t("foo.bar")
-> "I love stackoverflow.com so much!"
?
If not, is there a way to self reference the yaml file?
foo:
bar:
I love *baz* so much!
baz:
stackoverflow.com
I18n.t("foo.bar")
-> "I love stackoverflow.com so much!"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…