i18next-parser icon indicating copy to clipboard operation
i18next-parser copied to clipboard

The keyPrefix argument is ignored in JavascriptLexer, and not in JsxLexer

Open ohardy opened this issue 2 years ago • 2 comments

To Reproduce

Name this file with .ts extension (configured with JavascriptLexer) and the keyPrefix is ignored, if you use JsxLexer instead, it's works

export default function useArticlesFilter() {
  const { t } = useTranslation('filters', { keyPrefix: 'articles' });

  return useMemo(() => {
    return {
      menuTitle: t('menu'),
      badge: {
        Component: ArticlesBadge,
      },
      panel: {
        Component: ArticlesPanel,
        query: ArticlesPanelQuery,
      },
    };
  }, [t]);
}

Expected behavior

Keyprefix should not be ignored

ohardy avatar Dec 21 '22 11:12 ohardy