You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
tomdohnal
changed the title
[DOCS] remove leading underscore from context names
[DOCS] remove leading underscores from context names
Jul 9, 2020
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!
The text was updated successfully, but these errors were encountered: