Dynamic translation help #82

Closed
vadviktor opened this Issue Sep 8, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@vadviktor

Hello!

I wish to get a little help. I do not have a long relationship with ruby yet and I am porting a project from php to ruby.
One of my translations have a dynamic part in it.

en.yml:

refs:
  refname_01:
    info:
      name: yamyam

In my haml template I have a variable containing the name of the 2nd level translation leaf:

refname = 'refname_01'

So I wish to have "yamyam" printed in the template using a dynamically constructed translation reference, something like:

= refs.#{refname}.info.name

Can you please help me find the right solution or direct me to the right forum where I can discuss this matter, please?

Thank you!

@ai

This comment has been minimized.

Show comment Hide comment
@ai

ai Sep 8, 2012

Owner
= t.ref[refname].info.name
Owner

ai commented Sep 8, 2012

= t.ref[refname].info.name

@ai ai closed this Sep 8, 2012

@ai

This comment has been minimized.

Show comment Hide comment
@ai

ai Sep 8, 2012

Owner

And welcome to Ruby world ^_^

Owner

ai commented Sep 8, 2012

And welcome to Ruby world ^_^

@vadviktor

This comment has been minimized.

Show comment Hide comment
@vadviktor

vadviktor Sep 8, 2012

I cannot say thank you enough! :)

I cannot say thank you enough! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment