Skip to content
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

Update types for reportNamespaces #945

Merged
merged 2 commits into from Sep 15, 2019
Merged

Update types for reportNamespaces #945

merged 2 commits into from Sep 15, 2019

Conversation

@skovy
Copy link
Contributor

skovy commented Sep 13, 2019

I'm working with SSR and stumbled across this issue and need access to only the used namespaces: #711.

As it appears, the suggestion is to use i18next.reportNamespaces.getUsedNamespaces()?

However, the types do not currently reflect that.

Previously

import * as i18next from 'i18next';

i18next.reportNamespaces.addUsedNamespaces(['translation']);
//      ^^^^^^^^^^^^^^^^
// Property 'reportNamespaces' does not exist on type 'i18n'
i18next.reportNamespaces.getUsedNamespaces();
//      ^^^^^^^^^^^^^^^^
// Property 'reportNamespaces' does not exist on type 'i18n'

After this Change

import * as i18next from 'i18next';

i18next.reportNamespaces.addUsedNamespaces(['translation']); // valid
i18next.reportNamespaces.getUsedNamespaces(); // valid, returns: `string[]`
skovy added 2 commits Sep 13, 2019
@coveralls

This comment has been minimized.

Copy link

coveralls commented Sep 13, 2019

Coverage Status

Coverage remained the same at 95.377% when pulling 5f36893 on skovy:skovy/update-types-for-namespaces into 1a42148 on i18next:master.

@skovy skovy marked this pull request as ready for review Sep 13, 2019
@jamuhl jamuhl requested a review from rosskevin Sep 14, 2019
@rosskevin rosskevin merged commit 826b5d1 into i18next:master Sep 15, 2019
4 checks passed
4 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
codeclimate All good!
Details
coverage/coveralls Coverage remained the same at 95.377%
Details
workflow Workflow: workflow
Details
@rosskevin

This comment has been minimized.

Copy link
Collaborator

rosskevin commented Sep 15, 2019

Thanks @skovy.

@jamuhl this can be a patch release.

@jamuhl

This comment has been minimized.

Copy link
Member

jamuhl commented Sep 16, 2019

published in react-i18next@10.12.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.