Page MenuHomePhabricator

SVG Translate to integrate with Content Translation
Open, Needs TriagePublic

Description

There is potential for integrating SVG Translate with Content Translation. A translator that adds an SVG image from the source article may be interested in translating such image.

The goal is to surface the access to the SVG Translate tool when it is needed, and provide basic guidance for the user to complete the task (considering this involved moving through different tools).

Proposed solution
We can support the integration in the following way:

  • Extend the image card for SVG images to include a "Translate image labels" option.
    • Ideally this should be shown only to those SVG images that contain at least one text label. If this is not technically feasible we can show it for all SVG images, but that would result in exposing useless options to the user which is not great.
  • The "Translate image labels" option can be expanded to show the following elements:
    • Explanatory text indicating that two steps are needed to complete the process.
    • A "Create a translated version" option that links to the SVG Translate tool (with the current image and languages of the translation already selected). This option uses the "imageAdd" icon from the icon repo. In addition, it shows an indicator ("newWindow" icon) that it will open in a new tab to help set that expectation.
    • A "Replace the existing image" option that will open the media selection for the user to select the new translated image (if it was uploaded to Commons) or upload it (if it was just downloaded). This option uses the "image" icon from the icon repo. To facilitate the process, the image name will be used as the initial value for the search field in the media dialog. Once the user selects the image, it replaces the existing image in the translation document.

You can check the interactive version of the workflow to see it in action using the Diagram article as an example.

Option for SVG imagesSteps to translate SVG exposed
CX-SVG-added.png (720×1 px, 194 KB)
CX-SVG-expanded.png (720×1 px, 206 KB)

There are some related bugs in this area for Content Translation. They don't affect the workflow described in this ticket directly, but can get in the way if the user deviates a bit their path. Relevant bugs:

Event Timeline

Hi! I'm Ton, and I'm in my freshman year of studying Aerospace Engineering at the Polytechnic University of Catalonia. Despite it not being featured in the main project page, I'd like to work on this task as part of Google Summer of Code. I've been a Wikipedian for 9 years, and I'm mostly active at the Catalan Wikipedia, where I'm a sysop.

Cawiki was one of the first Wikipedias to incorporate the Content Translation tool, and the community there is really receptive to these changes. Adding the SVG Translate tool would be of great help, especially with Featured Articles, since translating the vector images is one of the requirements. Not many people use Inkscape or similar software, so a couple of years ago I started this page to help out.

As a member of Amical Wikimedia, I may attend the Wikimedia Hackathon 2019 in Prague, so we could even start before the official coding period begins. Since this task isn't listed here, I'd have to look for a mentor myself – would anyone be interested in that? Also, are there any tasks I can start to work on?

Hi! I'm Ton, and I'm in my freshman year of studying Aerospace Engineering at the Polytechnic University of Catalonia. Despite it not being featured in the main project page, I'd like to work on this task as part of Google Summer of Code. I've been a Wikipedian for 9 years, and I'm mostly active at the Catalan Wikipedia, where I'm a sysop.

Cawiki was one of the first Wikipedias to incorporate the Content Translation tool, and the community there is really receptive to these changes. Adding the SVG Translate tool would be of great help, especially with Featured Articles, since translating the vector images is one of the requirements. Not many people use Inkscape or similar software, so a couple of years ago I started this page to help out.

As a member of Amical Wikimedia, I may attend the Wikimedia Hackathon 2019 in Prague, so we could even start before the official coding period begins. Since this task isn't listed here, I'd have to look for a mentor myself – would anyone be interested in that? Also, are there any tasks I can start to work on?

Thanks for your interest, @Townie! This is an interesting idea and I'd love to see it in action.

@Samwilson @Mooeypoo Would either/both of you be interested in mentoring @Townie on this project? I can co-mentor on the product side.

@Samwilson @Mooeypoo If you are interested, here is the guide for mentors.
@Pginer-WMF Do you see it as a solid GSoC project? Do you happen to know anyone working in Content Translation who could mentor me? Thanks a lot!

@Samwilson @Mooeypoo If you are interested, here is the guide for mentors.
@Pginer-WMF Do you see it as a solid GSoC project? Do you happen to know anyone working in Content Translation who could mentor me? Thanks a lot!

@Townie This project is going to be heavy work on the ContentTranslation side. I love the idea and would like to see it happen but the majority of the work is outside our area of expertise. If someone from @Pginer-WMF's team can be a primary mentor, that would be great.

@Pginer-WMF Do you see it as a solid GSoC project? Do you happen to know anyone working in Content Translation who could mentor me?

I think it is an interesting project. I can create and share some designs to illustrate how the integration can be exposed to the user. I'll ping engineers in the Language team to check if anyone is available to help with this.

I edited the ticket description with a proposed design for the integration. Please, let me know if you have any comments.

@Niharika, the workflow proposes to access the SVG Translation tool with the image and languages prefilled. Checking the url of this example it seems possible to link to a specific image. However, I don't see parameters in the url are set when the languages are selected. Can you confirm whether there is some way for setting the initial value of the languages through the URL. If that does not exist, extending the tool to add those could be part of the project too.

I edited the ticket description with a proposed design for the integration. Please, let me know if you have any comments.

@Niharika, the workflow proposes to access the SVG Translation tool with the image and languages prefilled. Checking the url of this example it seems possible to link to a specific image. However, I don't see parameters in the url are set when the languages are selected. Can you confirm whether there is some way for setting the initial value of the languages through the URL. If that does not exist, extending the tool to add those could be part of the project too.

Currently we don't do that but it should be possible to add that functionality. Do we have someone on Language who's willing to mentor @Townie? The application deadline is at the end of this week.

@Niharika Since no one from the Content Translation side has come up, would you mind being my mentor, at least temporarily? I am writing my proposal, and I should include someone. I'll be working on fixing the bugs @Pginer-WMF has linked during the next few days.

Do we have someone on Language who's willing to mentor @Townie? The application deadline is at the end of this week.

@Petar.petkovic seems interested in mentoring. I hope we are still on time (team members traveling during these weeks have delayed the coordination a bit, sorry).

Do we have someone on Language who's willing to mentor @Townie? The application deadline is at the end of this week.

@Petar.petkovic seems interested in mentoring. I hope we are still on time (team members traveling during these weeks have delayed the coordination a bit, sorry).

Thanks a ton, that's great! I've submitted my proposal at task T220440. I've included @Petar.petkovic as my main mentor, if you have any suggestions regarding the proposal, feel free to say anything!

@Townie Great proposal :) @Petar.petkovic @Niharika I've sent you both invitation to sign-up as a mentor on the GSoC site. It would be great if at least one of you could be active there.

@Townie I can sign up as mentor temporarily but I am not sure how much I'll be able to help with, practically speaking. @Samwilson/@MaxSem Interested in mentoring Townie for this project? For our side, the work involves exposing the API for adding translations and allowing users to upload them before re-routing them to ContentTranslation with the updated image.

I've already mentored a project related to SVG Translate in the past, and since it didn't go very well, I'd rather pass.

I'm keen to help! I don't think the changes on the svgtranslate side sound huge.

Do I need to sign up somewhere?

@Samwilson Thanks! Just sent you an invite.

I will follow-up w/ you all via email when the application deadline is over.

Change 521837 had a related patch set uploaded (by Townie; owner: Townie):
[mediawiki/extensions/ContentTranslation@master] Display dialog to translate vector files

https://gerrit.wikimedia.org/r/521837

@Pginer-WMF So, should the "Replace the existing image" open up a MWMediaDialog, just like the Edit button?

@Pginer-WMF So, should the "Replace the existing image" open up a MWMediaDialog, just like the Edit button?

The edit button for an image opens a dialog that is mainly focused on changing the caption, not replacing the image. It also has a "Change image" option that opens an additional dialog, which it is specific for replacing the image:

Jul-10-2019 12-01-21.gif (383×640 px, 3 MB)

If we lead the users to the general edit dialog, they have to figure out and do the next step. It would be preferred to lead them directly to the place where they can just pick the new image. So I'd propose to consider to open the media selection dialog for the user to pick the image. That's the dialog that is used when clicking "Change image", and when inserting a new image (clicking on the "..." option in the edit toolbar and selecting "media").

Is there anything remaining in this task from GSoC'19? If not, then please consider marking it as resolved! If yes, and would need another GSoC or volunteer help then consider creating a new task with the leftover items. Thanks!

I would like to keep this one open for now as @Townie may want to stick with this until his work is merged. T220440 is closed as GSoC is officially done.

Change 521837 abandoned by Nikerabbit:

[mediawiki/extensions/ContentTranslation@master] Display dialog to translate vector files

Reason:

Old patch, not aligning with our plans.

https://gerrit.wikimedia.org/r/521837