opral / inlang-paraglide-js

Tree-shakable i18n library build on the inlang ecosystem.
https://inlang.com/m/gerre34r/library-inlang-paraglideJs
22 stars 0 forks source link

Support `import { m } from '...'` on vscode extension #151

Open jeiea opened 3 weeks ago

jeiea commented 3 weeks ago

Background

I'm using paraglidejs with nextjs. To take advantage of the automatic import, I re-exported the contents of message.js, like export * as m from './paraglide/messages'.

Expected behavior

Extension's translation preview should work.

Actual behavior

Don't work.

Additional context

I suspect this line, can you do what the title asks?

jeiea commented 3 weeks ago

I could achieve this by modifying settings.json modules. I suggest changing the defaults.

juliomuhlbauer commented 2 weeks ago

Is there some problem using this approach, besides the extension.

jeiea commented 2 weeks ago

Is there some problem using this approach, besides the extension.

Could you elaborate more? If 'this approach' refers to the * as m syntax, I don't prefer it because it requires additional work:

juliomuhlbauer commented 2 weeks ago

I agree. I thought about the nextjs compiler/paraglide importing all messages. I don't think it is a problem right?

jeiea commented 2 weeks ago

I don't think it is a problem right?

It's not really a problem but more of a feature request. I'm not suggesting to drop the * as m syntax, but to also support an alternative syntax.