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
Feature: key prefix option #1644
Conversation
I would like to also update the docs, I'm not sure how to do it, as I haven't found docs sources in this repo. |
index.d.ts
Outdated
ns?: string | readonly string[], | ||
keyPrefix?: string, | ||
): TFunction; | ||
getFixedT(lng: null, ns: string | readonly string[], keyPrefix?: string): TFunction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably an additional signature with second argument null is also needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated second signature to allow null
value for ns
argument. This should have the same effect as creating third signature getFixedT(lng: null, ns: null, keyPrefix?: string): TFunction;
. @adrai wdyt?
beside the typescript signature, it lgtm |
Thank you. v20.6.0 has just been released. |
Adds optional
keyPrefix
parameter togetFixedT
function in order to allows for improved developer experience when querying deeply nested keys with common prefix.Original GH issue (from react-i18next): i18next/react-i18next#1359
Checklist
npm run test
Checklist (for documentation change)