It's not a bug in the plugin per se but a "bug" in the docs.
In the default context section you use ['_male', '_female'] as the default values and ["_fruit", "_animal"] as an example user value.
The problem with that is the leading underscore before the values - if you actually provide values with leading underscores in your babel config, the plugin that prepend another underscore when extracting the translations. This leads to the translation keys having two underscores instead of one (e. g. "your translation key__female" instead of expected "your translation key_female"). And if you use the default context separator, which happens to be just one underscore, it breaks.
I'm happy to send a PR but I first wanted to discuss it with you as it might be intentional for some reason I overlooked :)
Describe the bug
It's not a bug in the plugin per se but a "bug" in the docs.
In the default context section you use
['_male', '_female']
as the default values and["_fruit", "_animal"]
as an example user value.The problem with that is the leading underscore before the values - if you actually provide values with leading underscores in your babel config, the plugin that prepend another underscore when extracting the translations. This leads to the translation keys having two underscores instead of one (e. g.
"your translation key__female"
instead of expected"your translation key_female"
). And if you use the default context separator, which happens to be just one underscore, it breaks.I'm happy to send a PR but I first wanted to discuss it with you as it might be intentional for some reason I overlooked :)
And thanks for your awesome plugin!