Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Customer nsSeparator To Typescript CustomTypeOptions #1467

Closed
vanenshi opened this issue Mar 11, 2022 · 1 comment · Fixed by #1471
Closed

Add Customer nsSeparator To Typescript CustomTypeOptions #1467

vanenshi opened this issue Mar 11, 2022 · 1 comment · Fixed by #1471
Assignees

Comments

@vanenshi
Copy link

🚀 Feature Proposal

current typescript CustomTypeOptions provides a way to customize the keySeparator. but there is no options to change the nsSeparator.

Motivation

even though I have the ability to customize the nsSeparator in the i18n init function, I have no way to provide it to the CustomTypeOptions, hence it would be impossible to use nsSeparator without getting an error from typescript

Example

// i18n-resources.d.ts
import * as resources from './locales';

declare module 'react-i18next' {
  interface CustomTypeOptions {
    defaultNS: 'common';
    nsSeparator: '.';
    resources: typeof resources['en'];
  }
}
@adrai
Copy link
Member

adrai commented Mar 13, 2022

v11.15.7 should address this thanks to @pedrodurek

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants