ngx-translate-messageformat-compiler
ngx-translate-messageformat-compiler copied to clipboard
Nested translation JSON files
Hey there
ngx-translate allows for nested translation json files. For example something like this:
{
"food": {
"pizza": "Pizza"
}
}
I would then reference pizza by the key "food.pizza".
However with ngx-translate-messageformat-compiler I get an exception when attempting to load such a nested translation file:
Expected identifier but "{" found.
Is there any way to get a nested translation json to work?
Hi! I was getting the same error, but using nested translation is not the cause of this error.
In my case convert all double braces {{}} to single braces {} solved this problem.
See more https://github.com/lephyrus/ngx-translate-messageformat-compiler/issues/45
Yes, using nested translations should not be a problem. Otherwise please re-open with a minimal (but complete) reproduction, for example on StackBlitz (fork the example at the top of the README).