Skip to content
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

[DOCS] remove leading underscores from context names #164

Open
tomdohnal opened this issue Jul 9, 2020 · 1 comment
Open

[DOCS] remove leading underscores from context names #164

tomdohnal opened this issue Jul 9, 2020 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@tomdohnal
Copy link

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!

@tomdohnal tomdohnal changed the title [DOCS] remove leading underscore from context names [DOCS] remove leading underscores from context names Jul 9, 2020
@gilbsgilbs
Copy link
Owner

Hi, thanks for raising an issue. Sorry for the delay, I've been quite busy lately (and still am). I'll happily merge your PR 😄 .

@gilbsgilbs gilbsgilbs added the documentation Improvements or additions to documentation label Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants