Closed ain closed 10 years ago
@ain this is a common issue with handlebars, did you search the handlebars documentation?
@jonschlinkert I have gone through it, but missed that bit. I'd appreciate a little education for sure so I can be more effective and pushing things forward :)
I never found a proper to solution because this is a problem with handlebars, it doesn't provide access to the parent context when changing context. We simply abandon using some helpers because of it. (The problem is with helpers not partials)
Take a look at these helpers I did. Hopefully it makes sense how I'm using these, I won't have much time to go into detail for a few days.
And they are being used here:
I was reviewing this and I don't think you should be using the i18n
helper at all with this plugin. The plugin should be loading in the correct data for the selected language, then you just use the data like in a normal handlebars template: {{description}}
.
If there's something else you're trying to do, please re-open this issue. If the issue is for the helper itself, please open the issue on that repo.
Thanks @jonschlinkert.
@doowb agreed, except that the current implementation of {{de_DE.key}}
for instance, is not useful and {{i18n[language].key}}
doesn't work. Also, you might need a key from a different language, e.g. to fix it.
In the partial
{{i18n "key"}}
will throw up with"The 'language' parameter is not defined"
, see helpers-i18n.js:28.Fails to get the language.