Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Add an option to include original line numbers within extracted message information #71

Closed
@antoinepm

Description

@antoinepm

Now that this plugin helps me extract the messages I need to translate (and it works great, thanks!), I am trying to generate a list of message-related issues (untranslated messages, etc.) further in my process. This is why I could use an additional "originalLineNumber" field in the extracted JSON data (or maybe "sourceLineNumber", or any other self-explaining name, of course). That information would let me find more quickly where, in the source code, the message is declared. Of course, the original file name would be useful too, but I can guess it from the JSON file path. And since not everybody is interested in the information, it could be made optional (maybe an "includeOriginalLineNumbers" option?).

Do you think it would be both possible and relevant?

A quick look at the plugin source code makes me think that the function storeMessage() could get the information from the property path.node.loc.start.line, when available. But then I may not be aware of some Babel subtleties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions