-
-
Notifications
You must be signed in to change notification settings - Fork 428
Description
Is your feature request related to a problem? Please describe.
I have a customized Trans component.
npx -- lingui extract does not extract messages from their direct usage.
import { Trans } from '~i18n';Macro usage works fine. runtimeConfigModule is configured as follows:
runtimeConfigModule: {
i18n: ['~i18n', 'i18n'],
Trans: ['~i18n', 'Trans'],
},Describe proposed solution
lingui extract should support Trans component imported from other locations than hardcoded @lingui/react.
In addition to Trans from @lingui/react, lingui cli can pick up runtimeConfigModule.Trans or something similar from config file.
Describe alternatives you've considered
lingui extract could pick up any <Trans /> usage regardless of import path, like it does with i18n._(). It would break backward compatibility, however.
Additional context
@lingui/react is hardcoded here:
| .referencesImport("@lingui/react", "Trans") |
Is runtimeConfigModule ignored by lingui-macro plugin when ran from lingui extract cli?