Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update screenshots on Weblate #3959

Closed
redshiftzero opened this issue Dec 4, 2018 · 7 comments
Closed

Update screenshots on Weblate #3959

redshiftzero opened this issue Dec 4, 2018 · 7 comments

Comments

@redshiftzero
Copy link
Contributor

Description

One thing we forgot about during the Weblate transition was the updating of the screenshots shown in the "Source Information" panel on the right hand side of each individual string translation page. The screenshots are no longer present:

screen shot 2018-12-04 at 9 53 07 am

We need to investigate and figure out how to update these and do so (one can do it through the admin interface but ideally we'd automate this, note there is an API endpoint for the screenshot). Relevant part of Weblate docs:

https://docs.weblate.org/en/latest/admin/translating.html#screenshots

User Stories

As a SecureDrop translator, I want a screenshot of the application when translating a particular string so I understand the context.

@redshiftzero
Copy link
Contributor Author

here's the API endpoint used to update the screenshots: https://docs.weblate.org/en/latest/api.html#post--api-screenshots-(int-pk)-file-

@eloquence
Copy link
Member

I'll take a stab at investigating this further during the 7/23-8/5 sprint, will loop in @rmol before or after his PTO.

@eloquence
Copy link
Member

Here's how I would approach this:

  1. Ensure that screenshots at https://weblate.securedrop.org/screenshots/securedrop/securedrop/ are consistently named in a manner that allows us to infer the layout test that generates them;
  2. Create a script that queries all screenshots using the Weblate API and, where a name match can be found against a layout test result in English, uploads the local PNG via API;
  3. Test this in the Weblate sandbox;
  4. If all looks good, run said script in prod to get us up-to-date;
  5. Go through all Weblate strings to make sure correct screenshot associations are in place; if warranted, add additional screenshots.

Does that make sense at a high level? If so, @rmol, I would be happy to collaborate with you on getting this done.

@rmol
Copy link
Contributor

rmol commented Aug 11, 2020

Yeah, I think this is a pragmatic approach. I had hoped to find a reliable way to avoid the manual work of associating source strings and screenshots, but I haven't, and given the rate of change, I'm not sure it'd be worth the effort. I think it will be easy enough to keep on top of this as part of the localization manager duties, once we finish this initial push.

I'd suggest we just clean out the existing screenshots and upload the new set named after the tests. It should at least be possible to write a quick script to list source strings grouped by location in the source code, which would make the initial association work more efficient.

@eloquence
Copy link
Member

eloquence commented Aug 12, 2020

I'd suggest we just clean out the existing screenshots and upload the new set named after the tests.

That makes sense. Just took a spin and I don't see any that can't be safely deleted and re-uploaded from the automated tests. I'd like to test the upload process itself in the sandbox, will discuss the best approach to doing so at at infra sync tomorrow.

It should at least be possible to write a quick script to list source strings grouped by location in the source code, which would make the initial association work more efficient.

That would indeed be super-helpful :-). Do you want to take a stab at that part, while I poke at the upload tooling?

@eloquence
Copy link
Member

@rmol Any initial feedback on the approach in #5450 would be awesome, happy to touch base synchronously as well if we manage to connect after the conference tomorrow or Friday :)

@eloquence
Copy link
Member

eloquence commented Aug 20, 2020

Screenshots have been uploaded using the tool merged in #5450:
https://weblate.securedrop.org/screenshots/securedrop/securedrop/

I've also taken a first pass through updating associations, which you can see here (use the "<" ">") to navigate between strings with screenshots)
https://weblate.securedrop.org/translate/securedrop/securedrop/en/?checksum=6f87bb1613e20ee4&q=has%3Ascreenshot&sort_by=-priority%2Cposition

I've also posted a note to the forum, here:
https://forum.securedrop.org/t/screenshots-are-back/1358

We should now be able to update these with each release. I'll file a follow-up issue to clarify i18n docs, and am closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants