Closed BorntraegerMarc closed 7 years ago
Hi Marc, it should already be possible by defining it as key:
{
"app.loginText": "Please log in before continuing!"
}
But you are right may be some one want this. It needs some more work (recursive searches for translation). If you want you can create a PR for it. Otherwise it will need some time till I developed it.
Yeah, I ment something like:
{
"app": {
"loginText": "Login"
}
}
Will try to open up a PR.
Hey, good news: I couldn't stop thinking of it and found an easy solution
I create the PR #5 . if this is ok for you I can create version 1.3. or you see another problem here?
I couldn't stop thinking as well and opened another PR :) Maybe we could combine them?
I checked out your PR @tflori and missed the the test that the return string needs to have dots included...
You missing a test? What test? In lines 184 and 185 in TranslateLoaderJson.spec.ts i'm testing that a dot is included in the translation key
yeah, I ment, that I am missing the test in my code... So I'm gonna add it now. The new PR is up soon.
@BorntraegerMarc npm update thanks for your contribution :smile:
Hi guys So I saw that nested objects are currently not supported in the default translate loader. This line disables it: https://github.com/tflori/angular2-translator/blob/master/angular2-translator/TranslateLoaderJson.ts#L48
Maybe including support for nested objects in the default translate loader would be a good idea? So something like this would be possible:
translate.translate("app.loginText")
cheers