BazingaJsTranslationBundle icon indicating copy to clipboard operation
BazingaJsTranslationBundle copied to clipboard

[#163] Added support for translation extractors for JS

Open jeremy-richard opened this issue 6 years ago • 8 comments

Improve PR https://github.com/willdurand/BazingaJsTranslationBundle/pull/164

Ping @willdurand, @JANorman, @monteiro @stof and @jcchavezs (thank you for helping me)

jeremy-richard avatar Jan 29 '18 14:01 jeremy-richard

Great work @jeremy-richard!

jcchavezs avatar Jan 29 '18 14:01 jcchavezs

I know CoffeeExtractorTest did not change from the previous PR https://github.com/willdurand/BazingaJsTranslationBundle/pull/164

Is JsExtractorTest OK? Should I do the same modifications to CoffeeExtractorTest, or define dataProviders onto a new parent class aka BaseExtractorTest ?

jeremy-richard avatar Jan 29 '18 14:01 jeremy-richard

I'd recommend to do the abstract class as they behave the same.

jcchavezs avatar Jan 29 '18 17:01 jcchavezs

Done, hopefully this feature will be available soon.

jeremy-richard avatar Jan 31 '18 09:01 jeremy-richard

@jeremy-richard looks good! Thanks for the great work.

Can you add just the missing break in all js and coffee files. That’s would be great.

Sorry for taking a lot of time.

monteiro avatar Feb 10 '18 09:02 monteiro

Do we really need two extractors? Why not allowing users to define the file extensions themselves? I can imagine .ts (typescript) as a useful extension. Thanks for this PR!

willdurand avatar Feb 10 '18 11:02 willdurand

@monteiro yep, I'll do that.

@willdurand hi, it sounds like a good idea. How would you like to proceed? I'd like to have a FrontEndExtractor, then set the extension to handle via the key bazinga_js_translation.frontend_extensions with the default value being ['js', 'jsx', 'coffee', 'ts']

Does the sequence will be the same for typescript then? (I've never code with typescript to be honest)

jeremy-richard avatar Feb 12 '18 08:02 jeremy-richard

@willdurand Hi, I found the way to have only one extractor to handle extraction from frontend files. Let me know how to improve it.

jeremy-richard avatar Feb 14 '18 13:02 jeremy-richard