tldraw
tldraw copied to clipboard
[rfc] botcom: start scaffolding for i18n
This starts rethinking our i18n story, at least at the botcom level.
- introduces (brings back)
react-intlwhich lets start doing more complex translations (being able to include HTML in sentences), do pluralization, time, etc. - adds a i18n middle layer to auto-generate ID's based on their hash, otherwise annoying to do this.
- you can see the different uses, there is the
<F>tag for translated React items - in other cases, you use
defineMessages/formatMessagefor things like alt/aria-labels/tooltips. - adds some hidden languages like "accented" to show which where things are untranslated.
- similarly, adds a debug mode to add an annoying red text shadow to highlight things that are untranslated.
- also adds a looooooong language for languages like German where things start breaking the UI (basically tests UI to where we should have some ellipsis or other considerations)
Change type
- [ ]
bugfix - [ ]
improvement - [ ]
feature - [ ]
api - [x]
other
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| examples | ✅ Ready (Inspect) | Visit Preview | Oct 30, 2024 0:58am |
| tldraw-docs | ❌ Failed (Inspect) | Oct 30, 2024 0:58am |
We incorrectly tag editor strings: Yeah, sorry, I should have noted that I haven't fully fleshed this out for the editor strings, definitely those would be excluded before going forward. I should note that before landing that this PR is an RFC really. It's not fully-baked — I've marked the title of this PR to reflect that.
Sorry for the confusion!
@MitjaBezensek this is ready for re-review. There's still more work to do, this just lays the groundwork.
We'll need to pull the app raw() strings to use this. I did a demo in Lokalise and it works fine as expected. So the next step is setting up an automatic pipeline to Lokalise as well.