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
This can cause multiple problems. In these cases the extractor does not work:
If someone uses a forked, scoped package (e.g. @fullstax/svelte-i18n).
If a project wants to import the format function not from 'svelte-i18n' directly but from a wrapper lib
(e.g. import { _ } from '../helpers/i18n), maybe to hide the i18n implementation detail.
If someone wants to use the extractor together with a compatible lib like svelte-intl-precompile.
Describe the solution you'd like
I propose to introduce a new cli parameter unsave to disable the library-check altogether.
This could look like this: svelte-i18n extract --unsave .
Describe alternatives you've considered
It would be possible to not use the hard coded lib-name but instead get the lib-name from the package.json. This would solve problem 1 but not 2 and 3.
It also would be possible to introduce a cli parameter to provide the lib-name directly.
e.g. svelte-i18n extract --lib-name "svelte-intl-precompile" .
This would solve problem 1 and 3 but not 2.
How important is this feature to you?
I'll provide a fix for this shortly. If this will not get merged within a few days I'll release my own fork.
The text was updated successfully, but these errors were encountered:
mojoaxel
added a commit
to fllstx/svelte-i18n
that referenced
this issue
Oct 1, 2023
Is your feature request related to a problem? Please describe.
The cli extractor checks if the format method was imported from the hard-coded string 'svelte-i18n'.
This can cause multiple problems. In these cases the extractor does not work:
(e.g.
import { _ } from '../helpers/i18n
), maybe to hide the i18n implementation detail.Describe the solution you'd like
I propose to introduce a new cli parameter
unsave
to disable the library-check altogether.This could look like this:
svelte-i18n extract --unsave .
Describe alternatives you've considered
It would be possible to not use the hard coded lib-name but instead get the lib-name from the
package.json
. This would solve problem 1 but not 2 and 3.It also would be possible to introduce a cli parameter to provide the lib-name directly.
e.g.
svelte-i18n extract --lib-name "svelte-intl-precompile" .
This would solve problem 1 and 3 but not 2.
How important is this feature to you?
I'll provide a fix for this shortly. If this will not get merged within a few days I'll release my own fork.
The text was updated successfully, but these errors were encountered: