Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jeiea opened this issue Jun 10, 2024 · 12 comments · May be fixed by opral/monorepo#3362
Open

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

jeiea opened this issue Jun 10, 2024 · 12 comments · May be fixed by opral/monorepo#3362

Comments

@jeiea
Copy link

jeiea commented Jun 10, 2024

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
Copy link
Author

jeiea commented Jun 10, 2024

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

@juliomuhlbauer
Copy link

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

@jeiea
Copy link
Author

jeiea commented Jun 11, 2024

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:

  • I have to manually insert the import statement at the beginning of the file.

    • This can be made easier with snippet configuration, but it requires manual setup and learning.
    • Scrolling for inserting is tedious.

@juliomuhlbauer
Copy link

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

@jeiea
Copy link
Author

jeiea commented Jun 12, 2024

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.

@elron
Copy link

elron commented Aug 12, 2024

I agree, auto importing m isn't easy, I needed to manually go to the docs, search for the import line, copy and paste it into my code.

Auto import would be nice.

I'm using SvelteKit by the way.

Screen Shot 2024-08-12 at 4 43 16 Screen Shot 2024-08-12 at 4 43 24

@jeiea
Copy link
Author

jeiea commented Aug 20, 2024

If there are no objections, is it okay to create a PR?

@juliomuhlbauer
Copy link

If there are no objections, is it okay to create a PR?

Did you create the PR?

@jeiea
Copy link
Author

jeiea commented Nov 22, 2024

Not yet.

@jeiea
Copy link
Author

jeiea commented Nov 29, 2024

I'm currently using i18n-ally for vscode and have lost motivation to continue with this. I'm leaving it open for others.

@juliomuhlbauer
Copy link

I'm currently using i18n-ally for vscode and have lost motivation to continue with this. I'm leaving it open for others.

But are you using Paraglide? I think is not supported by the extension

@samuelstroschein
Copy link
Member

@jeiea if you do a PR, i'll quickly review and merge it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants