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

React Support #280

Closed
zackargyle opened this issue Nov 6, 2015 · 4 comments
Closed

React Support #280

zackargyle opened this issue Nov 6, 2015 · 4 comments

Comments

@zackargyle
Copy link

Hey guys,

We are using React for newer projects, and it would be great to have lexer support for JSX syntax. As an example, all three strings are not picked up. In one place only String 2 is picked up, where in another place String 1 and String 3 are picked up, but not String 2. Adding JSX support should fix the "randomness".

    <option value="val1">{ i18n._('String1') }</option>
    <option value="val2">{ i18n._('String 2') }</option>
    <option value="val3">{ i18n._('String 3') }</option>

Seems to not be consistent for const in ES6 classes as well.

@mitsuhiko
Copy link
Member

I wonder if we can use babel (the js one) to parse it.

@zackargyle
Copy link
Author

That's what I ended up doing in my jenkins job. Run it through babel, then extract. Wasn't too big of a deal, but build-in support could be nice.

ezmiller added a commit to ezmiller/trellis that referenced this issue Dec 26, 2015
Pybabel has trouble extracting from JSX files (see here
python-babel/babel#280). So we
decided to do extraction by compiling components into js
just for the extraction process and then using pybabel's js
config setting to get the translations.
@akx akx self-assigned this Dec 30, 2015
@akx
Copy link
Member

akx commented Dec 30, 2015

Adding rudimentary JSX support shouldn't be too hard. Working on it!

akx added a commit to akx/babel that referenced this issue Dec 30, 2015
akx added a commit to akx/babel that referenced this issue Dec 30, 2015
akx added a commit to akx/babel that referenced this issue Jan 4, 2016
akx added a commit to akx/babel that referenced this issue Jan 18, 2016
@akx
Copy link
Member

akx commented Feb 10, 2016

@zackargyle If you're around, would you care to do a bit of code review on #332? :)

@akx akx closed this as completed in 8fee76c Mar 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants