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

Fix L10n: messages-compiled.json are not compiled automatically by vite #114

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jermy-c
Copy link
Collaborator

@jermy-c jermy-c commented Jun 30, 2024

Changes

  • Removed extra compile step i.e. messages-compiled.json
  • Use @lingui/vite-plugin added ?lingui to message.json imports for compilation when running vite
  • Added @lingui/vite-plugin to e2/electron.vite.cofig.ts

@jermy-c jermy-c requested a review from benbucksch June 30, 2024 18:57
@jermy-c jermy-c self-assigned this Jun 30, 2024
@jermy-c jermy-c linked an issue Jun 30, 2024 that may be closed by this pull request
import { messages as ru } from './locales/ru/messages-compiled.json';
import { messages as sv } from './locales/sv/messages-compiled.json';
import { messages as uk } from './locales/uk/messages-compiled.json';
import { messages as ar } from './locales/ar/messages.json?lingui';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to keep the 'messages.compiled.json' (preferably with . instead of -) instead of the ?lingui query? I think that would be safer, avoiding confusion, and might also work better with the installed version of the app.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem possible, in the source code it searches for .po or ?lingui. And there isn't a way to change that.
https://github.com/lingui/js-lingui/blob/0f6661799acfb62c4d169cacc8f6867278263f0e/packages/vite-plugin/src/index.ts#L11

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 🤣 🙄

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 this pull request may close these issues.

L10n: messages-compiled.json are not compiled automatically by vite
2 participants