Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic translation help #82

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

Dynamic translation help #82

vadviktor opened this issue Sep 8, 2012 · 3 comments

Comments

@vadviktor
Copy link

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
Copy link
Member

ai commented Sep 8, 2012

= t.ref[refname].info.name

@ai ai closed this as completed Sep 8, 2012
@ai
Copy link
Member

ai commented Sep 8, 2012

And welcome to Ruby world ^_^

@vadviktor
Copy link
Author

I cannot say thank you enough! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants