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

Add a --garble option to localebuilder. #1468

Merged
merged 11 commits into from
May 19, 2020
Merged

Add a --garble option to localebuilder. #1468

merged 11 commits into from
May 19, 2020

Conversation

toolness
Copy link
Collaborator

@toolness toolness commented May 19, 2020

Well I probably shouldn't have done this, but I was so loathe to manually find un-internationalized text in our codebase that making this was more fun, so here we are.

When one runs node localebuilder.js --garble, the non-English message catalogs will be replaced with "garbage" translations, which makes it easy to see what's not localized in the app. Here's a screenshot:

image

Obviously the garbage translation should never actually be committed.

The tricky part about this was preserving Lingui's React tags and ICU MessageFormat syntax. While it's code that will only ever be used during development, the only reasonable way forward was by writing the tests first, and then making them pass (TDD).

@toolness toolness merged commit ebca1a8 into master May 19, 2020
@toolness toolness deleted the garble branch May 19, 2020 22:15
toolness added a commit that referenced this pull request May 21, 2020
So #1468 only garbled lingui-generated PO files; this one adds support for garbling Django PO files too, while attempting to preserve gettext variables.
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.

1 participant