-
-
Notifications
You must be signed in to change notification settings - Fork 576
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
parser.flattenObject is called too often #47
Comments
Hmm interesting yes, I'll take a look at this. If you want to do a PR you can :) |
During the PR I recognized that the |
Well it's nice to have it on github if people need it for plunkr (or something like that). |
For that there is: https://npmcdn.com/ng2-translate/bundles/ng2-translate.js |
Ahh nice, I didn't know that one. |
As the language definition JSON object can get complex, it is a performance penalty to always flatten this JSON, any time a
translate.get
(ortranslate.instant
) is called.I'd recommend the other way: parsing the key (split by dot) and try to address the JSON field recursively.
E.g. (just a dummy demonstration):
The text was updated successfully, but these errors were encountered: