feat: add polish and features to localization modal#959
Conversation
…ranslation functionality
…URL handling in DocumentPage
| } | ||
| setLoadingState('loading'); | ||
|
|
||
| // SVG files are not supported by the AI vision API, so fetch the SVG |
There was a problem hiding this comment.
this doesn't seem related to this PR, mind moving it to its own PR?
| const localizationModal = useLocalizationModal(); | ||
|
|
||
| // Read URL params for locale sync and deep linking. | ||
| const urlParams = new URLSearchParams(window.location.search); |
There was a problem hiding this comment.
this doesn't feel like a react-y pattern to me, is it better to move this to a prop?
There was a problem hiding this comment.
hm, turns out i can switch to useLocation from preact-iso here - is this enough or do you want a bigger change?
There was a problem hiding this comment.
yeah i think useLocation() works. the issue with reading from window.location directly is that it doesn't trigger any callbacks and cause reactive state changes if any other part of the app changes the url, so it's better to use some sort of hook or react system that updates the component state whenever it changes.
| onClick={() => | ||
| onClick={() => { | ||
| const params = new URLSearchParams(window.location.search); | ||
| const locale = params.get('locale') || undefined; |
There was a problem hiding this comment.
can this use query.locale (or the urlLocale var defined above)?
|
taking a closer look at the screenshot you provided, i feel like the green circle checkmark is too prominent and it isn't clear to me at a glance what it's for. i'm wondering if it makes sense to show the % translated as a string instead, maybe next to the "Translations" title, something like ( |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
done! |
|
updates look good, thanks! |






Uh oh!
There was an error while loading. Please reload this page.