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

discover c-3po functions by require #44

Closed
AlexMost opened this Issue Apr 7, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@AlexMost
Member

AlexMost commented Apr 7, 2017

for now c-3po functions are discovered only by imports, but it is also necessary to discover them by require to make everything work on the backend side.

babel-plugin-c-3po should be able to discover this:

const { t } = require('c-3po');

@AlexMost AlexMost added this to the 0.5.0 release milestone Apr 7, 2017

@alxpy alxpy self-assigned this Apr 12, 2017

@AlexMost AlexMost removed this from the 0.5.0 release milestone Apr 18, 2017

@alxpy

This comment has been minimized.

Member

alxpy commented Apr 19, 2017

it works now!

const { t } = require('c-3po');
console.log(t`test text`);  // test text
@AlexMost

This comment has been minimized.

Member

AlexMost commented Apr 20, 2017

@alxpy This works in a library because it's a valid javascript. But it will not be extracted and resolved by babel plugin.

@snowwm

This comment has been minimized.

snowwm commented Jul 19, 2018

Any updates on it? Or at least workarounds? It looks like one can use discover: [ 't' ] in babel-plugin-ttag options, but not from ttag-cli, unfortunately. Plugin options from .babelrc don't get automatically merged. It can be done manually with babel-merge, though.

@AlexMost

This comment has been minimized.

Member

AlexMost commented Jul 19, 2018

@snowwm hey, thanks for using our tool. Going to implement this feature on this week.
Also created a separate issue for merging options from .babelrc - ttag-org/ttag-cli#38

@AlexMost

This comment has been minimized.

Member

AlexMost commented Jul 20, 2018

Preminor versions with this functionality are available:

babel-plugin-ttag@1.1.0-0
ttag-cli@1.1.0-0

Feel free to report any issues.

@AlexMost AlexMost closed this Jul 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment