question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extract messages from TypeScript files

See original GitHub issue

It would be really nice if the cli could extract messages from .tsx? files as well.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
tricoder42commented, Aug 28, 2017

Hi! I finally refactored cli to support other preprocessors than babel. I created package typescript-lingui-extract-messages where I placed your script: https://github.com/lingui/js-lingui/blob/master/packages/typescript-lingui-extract-messages/src/index.ts

However, I’m not able to compile it. Could you please send me configuration which you used to compile this file?

2reactions
johansigfridscommented, Jul 17, 2017

I took a quick stab at it. What I have is here, with both ts and js versions. All the fancy file handling is missing. Currently the extract function just expects a file name and returns a map of messages. This is all I have time for now. I might have some more time to look at it next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extracting $localize messages from typescript not working ...
I found a workaround: since only the extraction to xlf files doesn't work but the translation after build:prod is well effective even for...
Read more >
gettext-extractor
A flexible and powerful Gettext message extractor with support for JavaScript, TypeScript and JSX. It works by running your files through a ...
Read more >
Playground Example - Import Export
Let's look at importing code from a module. import { danger, message, warn, DangerDSLType } from "danger"; // This takes a set of...
Read more >
Message Extraction | Format.JS
Now that you've declared some messages, it's time to extract them.
Read more >
TypeScript Programming with Visual Studio Code
create new file. Now add the following TypeScript code. You'll notice the TypeScript keyword let and the string type declaration. let message: string ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found