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

How access translations in a structured json? #37

Closed
marcbruederlin opened this issue Aug 10, 2014 · 2 comments
Closed

How access translations in a structured json? #37

marcbruederlin opened this issue Aug 10, 2014 · 2 comments

Comments

@marcbruederlin
Copy link

How can I access translations in a structured json?

My json:

{
    "first-level": "shown",
    "test": {
        "lorem": "ipsum",
        "foo": "bar"
    }
}
req.i18n.__('first-level') // prints "shown"
req.i18n.__('test.lorem') // prints "test.lorem"
@netpoetica
Copy link

Can you do

req.i18n.__('test').lorem

?

@marcbruederlin
Copy link
Author

Yes, thank you! :)

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