You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have multiple invocations of useTranslation using different namespaces on the same page, the extraction does not work correctly.
To Reproduce
Create a component like:
constuseSchema=()=>{const{ t }=useTranslation('validation');t('errors.invalid_type_received_undefined')// Note: `errors.invalid_type_received_undefined` is in ns validation// ...};exportconstHomePlanStep=()=>{const{ t }=useTranslation(['application-address','common']);useSchema()return<p>{t('homePlanStep.submitBtnText')}</p>// Note: this is in ns application-address};
The dictionary that gets generated incorrectly has errors.invalid_type_received_undefined associated with NS: 'application-address'. The actual app runs just fine like this, only the extraction generates incorrect dictionaries.
If I make the following change, the dictionary gets generated correctly:
constuseSchema=()=>{const{ t }=useTranslation('validation');t('errors.invalid_type_received_undefined',{ns: 'validation'})// Note: added explicit ns// ...};
Now the dictionary does not associate errors.invalid_type_received_undefined with NS: 'application-address'.
Expected behavior
The extractor should not mix-up namespaces when extracting
Your Environment
runtime version: Node v18.19.0
i18next version: v23.7.16
i18next-parser version: v8.12.0
os: MacOS Sonoma 14.2.1
The text was updated successfully, but these errors were encountered:
🐛 Bug Report
If I have multiple invocations of
useTranslation
using different namespaces on the same page, the extraction does not work correctly.To Reproduce
Create a component like:
The dictionary that gets generated incorrectly has
errors.invalid_type_received_undefined
associated with NS: 'application-address'. The actual app runs just fine like this, only the extraction generates incorrect dictionaries.If I make the following change, the dictionary gets generated correctly:
Now the dictionary does not associate
errors.invalid_type_received_undefined
with NS: 'application-address'.Expected behavior
The extractor should not mix-up namespaces when extracting
Your Environment
The text was updated successfully, but these errors were encountered: