Skip to content

Add file path to the item in po file #81

@mjrdnk

Description

@mjrdnk

Our PMs want to have information about path to the file where translation was found in po files.

Like this:

#: path1WhereStringWasFound:<line#>
#: path2WhereStringWasFound:<line#>
msgid "string"
msgstr "translation"

I would like to create pull request with this feature.
I propose that the feature will be activated with yargs flag (e.g.: 'path-info').

By reading your code, I could not find any information about the matching path passed to the extract.
Where would you suggest to pass the information about the path?
So the compiler could extract them, for example like this:

compilers/po.compiler.ts :

    ...
	translations[key] = {
            paths: paths,    // array of paths where the file was found
	    msgid: key,
            msgstr: collection.get(key)
        };
    ...

Hope this helps others, too.
Best

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions