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:
const useSchema = () => {
const { t } = useTranslation('validation');
t('errors.invalid_type_received_undefined') // Note: `errors.invalid_type_received_undefined` is in ns validation
// ...
};
export const HomePlanStep = () => {
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:
🐛 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