weblate icon indicating copy to clipboard operation
weblate copied to clipboard

Upload screenshot from clipboard

Open StefanBrand opened this issue 4 years ago • 6 comments

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: image

StefanBrand avatar Oct 25 '21 06:10 StefanBrand

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.

github-actions[bot] avatar Oct 26 '21 10:10 github-actions[bot]

+1

I was just going to write this feature request myself. It would be a great help indeed.

luebbe avatar Oct 28 '21 10:10 luebbe

@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?

ptse888 avatar Nov 16 '21 22:11 ptse888

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 avatar Nov 17 '21 12:11 nijel

@nijel I have some questions:

  1. Where we add javascript code for some actions on html, do we have any rules for that?

  2. What the recommended way to test changes in html files, I am trying to see what data comes in add_form and implement the logic for pasting from clipboard for images ?

  3. Do we want this for all file types or just for images?

  4. Can you please add instructions to access different type of forms in UI?

ParthS007 avatar Jul 01 '22 13:07 ParthS007

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.

nijel avatar Jul 04 '22 11:07 nijel