[WIP] Attempt to add support for lingui. #497
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 attempts to add support for lingui (see #12 for more details on what it is, and what its pros/cons are relative to other i18n frameworks).
We only translate one string in the whole app: the
Is your landlord not responding? Take action today!
text.Notes
add-locale
,extract
, andcompile
scripts topackage.json
but I'm concerned thatcompile
in particular might get easily confused withbuild
, so I've prefixed them all withlingui:
. Unfortunately some of the CLI tools explicitly mention the non-namespaced names, which could also result in confusion. I guess there is no winning here right now.To do
Right now this hard-codes an import of the English messages catalog, which isn't great. We should figure out how to actually choose a locale the user wants, although I suppose it could wait for a future PR since it will likely be a lot of work.
Add documentation to the readme.
Add a test to ensure that the message catalog thingys are up-to-date with the source code.
Add a test to ensure that localization works (possibly an integration test).
Consider just migrating to using presets (specifically react and lingui) instead of individually importing plugins. Right now I think we have to work around this in our lingui config which is annoying. But since using the react preset will affect things outside of just l10n we can leave that for a separate PR, too.