-
Notifications
You must be signed in to change notification settings - Fork 5
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
Raise errors on long i18n message ids #1438
Conversation
Ok @toolness, I just added ID tags to fix all of our msgid-length warnings! I decided to set the threshold to 175 characters, as this seemed to be a good break point in the list of messages that we got. |
t( | ||
"norent.tweetTemplateForSharingNoRent" | ||
)`No idea how you'll pay rent this month? Tell your landlord with norent.org from @JustFixNYC. This free tool sends a certified letter informing them of your protections. Join the #cancelrent movement at norent.org.` |
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.
Oh super dope, I didn't realize there was a way to manually specify an ID for these non-JSX thingys!
Awesome thanks! I'll fix up the letter builder ones and then activate HARDFAIL and merge! |
oh wow, thanks, I didn't actually realize you addressed all the warnings, not just the ones in primary pages! |
So #1438 helped us reduce the size of our browser code footprint, but Crowdin didn't like it much, because it presented the message ID as the string to be translated, rather than the English version of the actual string. Fortunately, after talking to Crowdin support, it looks like this is remedied with a simple header on the PO file, which this PR adds.
From a Slack conversation:
This adds functionality to our localebuilder tool which
logs warnings (which we could convert to errors in a future PR)raises errors whenever lingui message catalog IDs are longer than100175 characters, indicating that significant space might be saved if we shorten them. We can always change the limit if we want, too.Here's a screenshot of its output:
Since localebuilder is run in production and the output is colorized, this PR also moves
chalk
from ourdevDependencies
todependencies
(it's already ultimately in there anyways due to various third-party packages independencies
already needing it).