i18next / i18next-parser

Parse your code to extract translation keys/values and manage your catalog files
MIT License
486 stars 198 forks source link

Improve namespace extraction from hook/HOC #854

Closed nicegamer7 closed 1 year ago

nicegamer7 commented 1 year ago

Why am I submitting this PR

While working on localizing our project, we used some code along the lines of the following:

export default withTranslation(undefined, { withRef: true })(
  ...
);

This resulted in the related strings being extracted under the "undefined" namespace, rather than using the default which is expected. Similarly, using a variable causes the strings to be extracted to a namespace that matches the name of that variable, rather than a warning being emitted.

Does it fix an existing ticket?

No.

Checklist

karellm commented 1 year ago

Thanks for the thorough PR! It is deployed as 8.2.0