Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Add support for hints in package.nls.json #33

Closed
wants to merge 2 commits into from

Conversation

Colengms
Copy link

@Colengms Colengms commented May 6, 2021

Addresses: #32

Hints can be added to package.nls.json in the following format:

    "key": {
        "message": "<message>",
        "comment": [ "<hint1>", "<hint2>" ]
    },

There was already support in place for objects with a message field in package.nls.json, so this should not break compatibility with that.

There was existing support in addFile() for a comment array to be pass in via the key (though, using message would have made more sense to me). This looks to be used by existing support for hints in calls to localize(). I updated createXlfFiles() to leverage this existing support to store hints/comments from package.nls.json in the key.
I also updated addFile() to use only the key string value itself for comparisons with existingKeys.

@Colengms
Copy link
Author

@dbaeumer Could you review this? Thanks!

@dbaeumer
Copy link
Member

I published 4.0.0-next.1. Since the code was quite outdated I did a cleanup and added the feature afterwards by hand based on what you have proposed. I also added tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants