-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/add metadata to supportedOptions for passing additional info #230
Feat/add metadata to supportedOptions for passing additional info #230
Conversation
Sorry @mmohajer, I have no idea 🤷 I'm not a regular contributor. I opened a small PR some time ago with a tiny docs change :) |
Hi @mmohajer, Sorry for that I don't quite understand your purpose of adding external options, because I cannot find the differences according to your new test case and was unable to find any Can you explain that in more detail and update the test cases to see how it works? Thanks. |
Hi @cheton! Thank you for your comment. The new option is
Basically, the object we pass as
I updated the description and the test case for more clarity. Please let me know if you have any other feedback. Thanks! |
Thanks for your explanation. I'm just thinking about the key name. How about using |
I updated the key name. Thanks for the feedback @cheton! |
Codecov Report
@@ Coverage Diff @@
## master #230 /- ##
==========================================
Coverage 91.13% 91.17% 0.04%
==========================================
Files 6 6
Lines 564 578 14
==========================================
Hits 514 527 13
- Misses 50 51 1
Continue to review full report at Codecov.
|
Published v3.2.0 https://www.npmjs.com/package/i18next-scanner?activeTab=versions |
The purpose is to add an option to the list of
supportedOptions
in order to be able to pass any additional information regarding the string. This new options is calledmetadata
and we can pass it as an object. For example, let's say we want to associate different tags to the strings. Using this new options we can have something like this:t("Translate me {{count}} times", {count: 100, metadata: {tags: ['tag1', 'tag2']}})
Note that what we define for
metadata
is a custom object based on the information we want to pass and in the above example, we used tags.Checklist
npm run test
Checklist (for documentation change)