Upload screenshot from clipboard
Is your feature request related to a problem? If so, please describe.
I often find myself taking screenshots from our web app via the Firefox screenshot tool. By default I always copy to clipboard so that I can paste the screenshot into other tools later. Unfortunately Weblate does not allow this. I must go back to the webapp, take the screenshot again and save it to disk. Then I must upload it to Weblate via the "Browse" button (navigating to the screenshot folder on my disk).
Describe the solution you'd like
Allow pasting screenshots into the "Add new screenshot" dialogue.*
*Might have to be resized automatically to comply with 2000x2000 px limit.
Describe alternatives you've considered
Download & Upload screenshots.
Screenshots
Paste screenshot into this dialogue:

This issue has been added to the backlog. It is not scheduled on the Weblate roadmap, but it eventually might be implemented.
In case you need this feature soon, please consider helping or push it by funding the development.
+1
I was just going to write this feature request myself. It would be a great help indeed.
@nijel i would like to work on this if possible! could you possibly direct me as to where i should be looking to make this modification?
The screenshot upload form is here:
https://github.com/WeblateOrg/weblate/blob/f785813127b8d40b4f9d9e41d6d26f63e35ac47a/weblate/screenshots/forms.py#L40-L59
It is being rendered here:
https://github.com/WeblateOrg/weblate/blob/f785813127b8d40b4f9d9e41d6d26f63e35ac47a/weblate/templates/screenshots/screenshot_list.html#L19-L32
@nijel I have some questions:
-
Where we add javascript code for some actions on html, do we have any rules for that?
-
What the recommended way to test changes in html files, I am trying to see what data comes in
add_formand implement the logic for pasting from clipboard for images ? -
Do we want this for all file types or just for images?
-
Can you please add instructions to access different type of forms in UI?
No rules so far. Historically, there has been a single JS file, but recently, we've started to split out some logic - we now have also weblate/static/editor/.
We're using django-crispy-forms, it should allow customizing the form rendering, see https://django-crispy-forms.readthedocs.io/en/latest/layouts.html. The screenshot forms are here: https://github.com/WeblateOrg/weblate/blob/main/weblate/screenshots/forms.py, and for now, I'd make this change only to allow pasting screenshots, not anything else.