i18next-parser
                                
                                
                                
                                    i18next-parser copied to clipboard
                            
                            
                            
                        Key extraction to wrong namespace
🐛 Bug Report
When using the useTranslation hook to get two different TFunctions scoped to different namespaces, extraction should place keys into the namespace of the corresponding TFunction.
To Reproduce
const { t } = useTranslation();
const { t: otherT } = useTranslations('otherNs');
const header = t('header string');
const otherHeader = otherT('other string that should not be extracted');
Expected behavior
Should get extracted to the default namespace:
// translation.json
"header string": "header string"
But gets extracted to the namespace provided to the other useTranslation hook:
// otherNs.json
"header string": "header string"
I believe this is the corresponding test that should be added, but haven't gotten much farther than that
// javascript-lexer.test.js
it('uses default namespace when other t function', () => {
    const Lexer = new JavascriptLexer()
    const content =
      'const {t} = useTranslation("baz");' +
      'const {t:otherT} = useTranslation("otherNs");' +
      't("bar");'
    assert.deepEqual(Lexer.extract(content), [
      { namespace: 'baz', key: 'bar', ns: 'baz' },
    ])
  })

Your Environment
- runtime version: node v14
 - i18next version: 21.5.2
 - i18next-parser version: 5.3.0
 - os: Mac
 - any other relevant information
 
@tylerrasor It is indeed a missing feature at the moment.
I just discovered the same bug with key prefixes instead of namespaces. Looks like i18next-parser threads all t functions with the config that appeared last.
const { t: tRoot } = useTranslation();
const { t } = useTranslation('translation', {keyPrefix: 'staticData.locations'});
                                    
                                    
                                    
                                
any progress here?