-
Notifications
You must be signed in to change notification settings - Fork 382
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
feat: add setMessagesCompiler method #2035
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
Had to exclude test from |
Something happened to Verdaccio. The WF uses:
Which is installing latest possible version, they published version 6 couple days ago and that might be the reason. I tried to fix v5 version, but it didn't help. The error:
However, the verdaccio itself is up and running: |
10b4225
to
afc1895
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, apologies for late reply. I have the same feedback as Andrii - docs :)
afc1895
to
3ba0769
Compare
48afff9
to
918c5b3
Compare
@andrii-bodnar @vonovak i added docs for that method. The better overall tutorial will be in next iterations after this epic finished |
Example usage: | ||
|
||
```ts | ||
import { compileMessage } from "@lingui/message-utils/compileMessage"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { compileMessage } from "@lingui/message-utils/compileMessage"; | |
// `compileMessage` is Lingui's default implementation | |
import { compileMessage } from "@lingui/message-utils/compileMessage"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's coming from @lingui/
scope, isn't it obvious enough? More over, this method wasn't built to make it possible to override a default implementation, so it's intended to use always with a default implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method wasn't built to make it possible to override a default implementation, so it's intended to use always with a default implementation.
That's a bit confusing to me because then I don't understand the use of this so much. But it's probably because other changes need to be done before this can be properly documented, as you said before.
isn't it obvious enough?
Well, just a few moments ago it felt obvious to me that I can use also something else other than the default implementation, so the word "obvious" can be a bit tricky.
If no other implementation should be used, the docs should say that imho.
Anyways, I don't want to block this PR from merging - I've raised the points I wanted to. 🙂👍
I'll defere to @andrii-bodnar
Description
Related user request: #2012
To achieve these goals,
i18n.setMessagesCompiler()
method was provided, which allow to manually register message compiler on production.Also, the format of compiled message was slightly changed.
Previously, if the message doesn't have any ICU features inside it was printed as a string, array used for the rest of cases. That make distinguishing between compiled and uncompiled message particularly hard and sometimes lead to double compilation which was tried to be fixed here #1913
Now uncompiled message is always a string, and compiled is always an array.
Some examples:
Types of changes
Fixes # (issue)
Checklist