Closed zmilonas closed 2 years ago
Hi zmilonas,
Thank you for reaching out.
Yes, you refer nested keys with a dot: "nested.key" for {nested: { key: "value" }. If there is no value for a key, the module returns the key so you can see where you are missing a translation.
I updated the documentation to clarify this behaviour.
Cheers!
Hey, firstly thanks so much for this package, saved me a headache.
As to the issue i can elaborate, add tests, reproducement scenarios and contribute later, but I want to point out that it seems to be when i tried using your package for some longer texts having them as keys, like full sentences, whenver there was a
.
in the key it would fail.Example:
index.ts:
gb.json:
Outputs:
While I expected:
The problem is especially concerning that there is no error message, not in the console, not anywhere about not finding the key, or that the key in the JSON contains what I might assume are disallowed characters. I also guess that the dot is reserved for drilling down the objects in the JSON, right? I didn't find that mentioned in the documentation and it left me confused.