[WIP EXPERIMENT] Add a fake i18n transform. #498
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a combination experiment/professional development exercise in which I learn how Babel transforms work and attempt to implement one that can do our localization.
Right now, all this does is convert some text that needs to be localized into UPPERCASE. It's disabled by default; to enable it, set
FAKE_I18N_TRANSFORM
in your.justfix-env
to one of the following:uppercase
will just uppercase all "internationalized" text.func
will run the text through a newi18n()
function, which currently returns a React component that wraps the text in a span that's styled with a border and a pink background. My idea is that we could use this kind of thing to provide a UI that allows translators to quickly translate the most visible parts of an app in-context by e.g. shift-clicking on text to translate it.