1

Trying to DRY up my en.yml for i18n:

en:
  phone: 800-123-4678

  errors:
    please_call: Please call 800-123-4678
    please_call2: Please call 800-123-4678 if you need assistance

Is there a way to reference a previously defined scalar and interpolate in another?

aceofspades
  • 7,568
  • 1
  • 35
  • 48

1 Answers1

0

Try

en:
  phone: 800-123-4678

  errors:
    please_call: Please call <%= phone %>
    please_call2: Please call <%= phone %> if you need assistance

Didn't try it but found another answer that says it should work. Try it out :)

Community
  • 1
  • 1
Lasse Bunk
  • 1,848
  • 20
  • 21
  • Your syntax might require scope, but it would require loading the yml differently. I've updated my question to specify this is to be used for Rails i18n which gets loaded normally... – aceofspades Jan 10 '12 at 22:45