Page MenuHomePhabricator

Update invite for translation when creating a new article
Closed, ResolvedPublic

Description

When users are creating a new page, we want to let them know that translating is an alternative. We want to support an invite that adapts to two different circumstances:

  • Provide a specific suggestion to translate the article the user tries to create (when we are able to find a suggestion for it)
  • Providing a general invite to try Content translation (only once, to introduce the tool).
Generic inviteSpecific invite

Details for each version are based on the original tickets (T216032, T216500), but detailed below for additional clarity:

Common aspects for both versions

  • Only when out of beta. This invite (in their two versions) is intended to be shown only on wikis where the tool is available out of beta. The reason is that in beta we cannot provide the access to settings for permanently disabling the invite (which can be problematic on the "specific version" which is shown more than once). For wikis where Content translation is in beta, the idea is to keep the old invite (F28209153).
  • Not getting in the way of the default action. The invite is shown at the bottom of the viewport to avoid covering the main information of the page.
  • Shown only to multilingual users. Based on T223888: Provide a way to find out if current user is potential translator, show the invite only to users that have accessed more than one language.
  • Access to the settings. A cog icon provides access to the user preferences to allow users to disable the entry points.
  • Don't show if it is the very first time for the user in the editor. The first time the user access the editor other welcome messages and tutorials appear and we don't want to interfere with those.
  • A cog icon provides access to the preferences (T223896) as a way to disable entry points if needed. Note that the settings are only available for wikis where the tool is available as default (i.e. out of beta).

Generic invite

  • Shown only once. Once the user replied once (accepting or closing) to a previous invite (generic or specific), the user will not see the generic invite again for any other language.
  • Don't show to existing Content translation users. If the user has ever started a translation they already know the tool and we don't need to show the invite.

Specific invite

  • Only when there is a page to suggest. The specific invite is shown only when there is a page to suggest, even if it was shown before for other pages. Note that other conditions from the first section above also apply (i.e., the user is likely to be multilingual, not the first time in the editor, etc.).
  • Clicking on the suggestion will lead to the Translation dashboard with the translation information pre-filled. Ready for the user to confirm and start to translate.
  • The "Find another page to translate" option will lead the user to the translation dashboard with the new translation dialog open for the user to search for an article to translate.
  • We may want to filter out disambiguation pages, not showing them as a suggestion.

Details

Related Gerrit Patches:
mediawiki/extensions/ContentTranslation : masterShow translation option when creating a new article

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 9 2019, 5:37 PM
Pginer-WMF triaged this task as Medium priority.Sep 9 2019, 5:37 PM
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF raised the priority of this task from Medium to High.Sep 16 2019, 10:40 AM
Pginer-WMF updated the task description. (Show Details)Sep 16 2019, 1:48 PM
Pginer-WMF updated the task description. (Show Details)
santhosh added a subscriber: santhosh.EditedSep 18 2019, 6:51 AM

Details for each version are based on the original tickets (T216032, T216500), but detailed below for additional clarity:

Here the word "version" means, one of the two designs, right?

Pau, can you explicitly state the non-beta and beta experience?

Don't show if it is the very first time for the user in the editor. The first time the user access the editor other welcome messages and tutorials appear and we don't want to interfere with those.

Not sure how to find out this in a non-hacky way.

Only when there is a page to suggest. The specific invite is shown only when there is a page to suggest, even if it was shown before for other pages. Note that other conditions from the first section above also apply (i.e., the user is likely to be multilingual, not the first time in the editor, etc.).

This is contrary to the assumptions we had while working on the suggestion api and invite. But if you confirm, I think the best way is :

  1. abandon https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/528746 ,
  2. Revert the merged patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/528632 and bring back the translator evaluation logic
  3. prepare a new commit
Pginer-WMF added a comment.EditedSep 18 2019, 7:59 AM

Details for each version are based on the original tickets (T216032, T216500), but detailed below for additional clarity:

Here the word "version" means, one of the two designs, right?

Yes. This is an invite that shows in two different ways/flavors/versions depending on the context. If there is a suggestion, it shows the specific version. If there is no suggestion, it shows the generic version. Each of those cases use a different design.

This can be interpreted (and translated into code) in different but compatible ways. You can think of these as:

  • Two different invites that show on different circumstances.
  • A single invite to show a suggestion, with a fallback (that is shown only once) when the suggestion is not available.

Pau, can you explicitly state the non-beta and beta experience?

This invite (in their two versions) is intended to be shown only on wikis where the tool is available out of beta. The reason is that in beta we cannot provide the access to settings for permanently disabling the invite (which can be problematic on the "specific version" which is shown more than once). For wikis where Content translation is in beta, the idea is to keep the old invite. The old invite is intended to introduce and enable the beta feature and does not use different designs:

I'll add this to the description to avoid confusions.

Don't show if it is the very first time for the user in the editor. The first time the user access the editor other welcome messages and tutorials appear and we don't want to interfere with those.

Not sure how to find out this in a non-hacky way.

A cleaner solution would be preferred, and based on conversations in this area, we can get support from the Editing team if changes in Visual Editor are required. In any case, a hacky solution may be better than exposing newcomers to these situations:

Only when there is a page to suggest. The specific invite is shown only when there is a page to suggest, even if it was shown before for other pages. Note that other conditions from the first section above also apply (i.e., the user is likely to be multilingual, not the first time in the editor, etc.).

This is contrary to the assumptions we had while working on the suggestion api and invite.

It is not clear which were the former assumptions. I don't see how proposing an article to translate when we could not find such article was intended to be supported with only the specific version. That is what we are trying to cover with the two versions (specific + generic)

But if you confirm, I think the best way is :

  1. abandon https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/528746 ,
  2. Revert the merged patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/528632 and bring back the translator evaluation logic
  3. prepare a new commit

Based on the screenshot you shared earlier (T216500#5408804) it seems that part of that work can be reused, but you know better the code, so feel free to proceed as it works the best.

Pginer-WMF updated the task description. (Show Details)Sep 18 2019, 8:05 AM

The VE config that shows the welcome dialog for first time editor is

mw.config.get('wgVisualEditorConfig').showBetaWelcome
santhosh claimed this task.Sep 23 2019, 5:02 AM

Change 528746 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Show translation option when creating a new article

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

Screenshot from the above patch:

Pginer-WMF added a comment.EditedSep 24 2019, 11:44 AM

Screenshot from the above patch:

Great to see this is taking shape. Some minor comments for follow-up polishing:

  • For the suggested item, would it be possible to reuse the layout and styling used for Content translation suggestions (with an added border)? With a square 84x84px image and applying the same margins and font sizes as the dashboard suggestion list, the text should fit much better.
    • The additional border should use as border color Base70 (#C8CCD1), 2px border radius, and the same shadows used for translation cards (box-shadow: 0 1px 1px rgba(0,0,0,0.15) ).
  • For "find another page to translate" it was intended to be a frameless progressive button. That is, shown in blue (accent50, #36c)
  • The cog icon does not seem to be aligned with any other element. The design above proposed to be symmetric in position to the "x" icon (i.e., the same distance to the bottom-right corner as the "X" one has to the top-right corner), rendering both at similar sizes. An alternative, if there are technical limitations to the previous approach, could be to align it vertically with the magnifying glass of the "find another" option, making both sit on the same line.

I have made some visual adjustments to the patch from @santhosh. Here are some shots:

Generic inviteSuggestion with no imageSpecific suggestion with image

After updating the patch to match @Pginer-WMF's design, I did additional checks to verify all the specs are in place.
@Pginer-WMF, once you verify above screenshots look good and following two items are acceptable, I'm merging the patch:

  • The invite does not go away after user starts typing inside the editor
  • Blue dot and invite could be shown simultaneously:

After updating the patch to match @Pginer-WMF's design, I did additional checks to verify all the specs are in place.
@Pginer-WMF, once you verify above screenshots look good and following two items are acceptable, I'm merging the patch:

  • The invite does not go away after user starts typing inside the editor
  • Blue dot and invite could be shown simultaneously:

Looks good to me in general. Just a couple of comments:

  • For "Suggestion with no image" it would be better not to stretch the page icon to the whole image area. More aligned to the same case on the suggestions list:

  • There seems to be some unnecessary padding at the bottom. Elements in the UI seem to be at a 16px distance from the top and the sides, but the bottom distance seems larger. The bottom distance should be reduced for a more balanced spacing.

  • The border for the suggestion element ("Spajdermen" in the last example) should follow the style proposed in T232372#5519234 : border color Base70 (#C8CCD1) with 2px border radius, and the same shadows used for translation cards (box-shadow: 0 1px 1px rgba(0,0,0,0.15) ).

I'm ok in this to get merged as it is and creating a followup ticket for the changes if this is too complex to correct in the current one, or a more detailed spec is needed.

I have made required changes. Here are the results:

Suggestion with imageSuggestion with no image

I would like to point out that for title "Incumbent", proposed article is a disambiguation page - Titulaire. Description says "We may want to filter out disambiguation pages, not showing them as a suggestion". @Pginer-WMF, you may want to create separate ticket to capture this. API introduced in T227571 offers disambiguation page as suggestion, this ticket is just about presentation.

I have made required changes. Here are the results:

Suggestion with imageSuggestion with no image

Nice improvements!
There is still one small aspect that seems to have diverged from the last version compared to previous mockups and screenshots: the bottom side of the whole panel should not be visible in the viewport (this simulates that the panel being an element that slides in from below). This can be achieved by either adjusting the relative position a few pixels down, or removing the bottom border and border-radius for the bottom part. Again, if this is not an immediate change, I'm ok creating a separate ticket.

I would like to point out that for title "Incumbent", proposed article is a disambiguation page - Titulaire. Description says "We may want to filter out disambiguation pages, not showing them as a suggestion". @Pginer-WMF, you may want to create separate ticket to capture this. API introduced in T227571 offers disambiguation page as suggestion, this ticket is just about presentation.

Good catch. Thanks, Petar. I created a separate ticket: T235172: Avoid suggesting disambiguation pages on the new translation invite

Change 528746 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Show translation option when creating a new article

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

Jpita added a subscriber: Jpita.EditedOct 14 2019, 3:34 PM

Building on Petar's comment, I got a weird proposed article, is this expected @Pginer-WMF?
Got this from

https://cx-ofb.wmflabs.org/index.php?title=Asd2&action=edit

Building on Petar's comment, I got a weird proposed article, is this expected @Pginer-WMF?
Got this from
https://cx-ofb.wmflabs.org/index.php?title=Asd2&action=edit

Suggestions may not always be perfect (users have the option to discard them). I don't know how representative this "asd2" case is, to represent the general way in which the feature works. It may be good to define a larger set of example title (some realistic and other edge cases) that allows to get more general conclusions.

I have looked this up, and there is a protein in human body called GATA4, which is also known as ASD2. We got this suggestion from GATA4 having ASD2 alias on Wikidata.
English Wikipedia page also lists ASD2 as an alias to GATA4. This is valid suggestion.

Jpita added a comment.EditedOct 15 2019, 4:17 AM

Nice, thanks .
I should have asked where it fetches the data from.
I'll investigate more on that front.

Jpita added a comment.Oct 17 2019, 5:20 AM

QA NOTES:

Common aspects for both versions

  • Only when out of beta. This invite (in their two versions) is intended to be shown only on wikis where the tool is available out of beta.
  • Not getting in the way of the default action. The invite is shown at the bottom of the viewport to avoid covering the main information of the page.
  • Shown only to multilingual users.
  • Access to the settings. A cog icon provides access to the user preferences to allow users to disable the entry points.
  • Don't show if it is the very first time for the user in the editor.

Generic invite

  • Shown only once. Once the user replied once (accepting or closing) to a previous invite (generic or specific), the user will not see the generic invite again for any other language.
  • Don't show to existing Content translation users. If the user has ever started a translation they already know the tool and we don't need to show the invite.

Specific invite

  • Only when there is a page to suggest. The specific invite is shown only when there is a page to suggest, even if it was shown before for other pages.
  • Clicking on the suggestion will lead to the Translation dashboard with the translation information pre-filled.
  • The "Find another page to translate" option will lead the user to the translation dashboard with the new translation dialog open for the user to search for an article to translate.
  • We may want to filter out disambiguation pages, not showing them as a suggestion. NOT WORKING, SHOWING DISAMBIGUATION PAGES


CHECK IN PROD:

  • DIFFERENT LANGUAGES ON TEXT
  • MISSING STUFF FROM THE ABOVE CHECKLIST

It was reported by @Jpita that new users on Javanese Wikipedia (on which CX is out of beta) are not seeing invite. I instructed him to edit articles on some non-Javanese Wikipedia and try again. The invite was not showing after that, so we did some investigation. Without a clear cause, I went on to investigate on my own.

After creating a new user on Javanese Wikipedia, I went to Serbian Wikipedia, found some article to fix typo and made an edit. Then, I opened https://jv.wikipedia.org/w/index.php?title=Paneer&action=edit&debug=1 to check if invite will show. First time, Visual Editor dialog was shown. I kept reloading as I was eliminating possible causes for invite not being shown. The script ext.cx.entrypoints.newbytranslation.js was not loaded, so I spent time checking conditions on server side.
I checked following with respective outputs:

ConditionOutput
mw.user.options.get( 'cx-enable-entrypoints' )true
mw.config.get( 'wgVisualEditorConfig' ).showBetaWelcometrue
mw.user.options.get( 'visualeditor-hidebetawelcome' )"1"

These options and configs were used to check if early return is needed. If early return does not happen, we get to the following line:
if ( $wgContentTranslationAsBetaFeature === false && self::isPotentialTranslator( $user ) )

Content Translation is no longer beta feature on Javanese. Check self::isPotentialTranslator( $user ) looks if user ever started any translation using CX. If not, we check CentralAuth for edit counts on Wikipedia sites. We can see that new user account I created has edits on Serbian Wikipedia - https://jv.wikipedia.org/w/index.php?title=Astamiwa:Otoritas_pusat&target=Testuser212

@santhosh What could be the reason for script ext.cx.entrypoints.newbytranslation.js not being loaded to show the invite?

Jpita added a comment.Oct 23 2019, 8:34 AM

Check self::isPotentialTranslator( $user ) looks if user ever started any translation using CX

This means the invite should only show to users that have NOT started any translation using CX, right?

Right now the invite is showing for users (example user: Testpitanormal) with translations done using CX, maybe the logic is inverted?

Check self::isPotentialTranslator( $user ) looks if user ever started any translation using CX

This means the invite should only show to users that have NOT started any translation using CX, right?
Right now the invite is showing for users (example user: Testpitanormal) with translations done using CX, maybe the logic is inverted?

Note that the "Don't show to existing Content translation users" requirement only applies to the "Generic invite" case. Since it does not make sense to introduce the tool to users that already know it. However, for the "specific invite" we want to suggest a relevant article to translate even if they are familiar with the tool.

Check self::isPotentialTranslator( $user ) looks if user ever started any translation using CX

This means the invite should only show to users that have NOT started any translation using CX, right?
Right now the invite is showing for users (example user: Testpitanormal) with translations done using CX, maybe the logic is inverted?

The name of the method is isPotentialTranslator. As name explains, method checks if user is a potential translator, to which we should show invites. @Pginer-WMF we're talking specific invite here. Anyway, the method can confirm that user is potential translator in two ways:

  1. User has made some translations with CX before
  2. User has edited more than one Wikipedia

Your Testpitanormal meets the first criteria, that is why you see the invite.

One more note. Condition #2 is how it should work, but we currently check if user has any edit on any Wikipedia. Ping @santhosh

Jpita closed this task as Resolved.Nov 8 2019, 7:10 AM

moving to Done after creating T237607 to continue the missing work from this ticket

moving to Done after creating T237607 to continue the missing work from this ticket

Thanks, @Jpita. By looking at the new ticket (T237607) and the checklist above ( T232372#5582887 ) it may not be clear which are the aspects that still need to be supported/verified. Can you copy the relevant items from the checklist to the new ticket? In that way it may be easier to make sure that all pending aspects are covered.

Thanks!

moving to Done after creating T237607 to continue the missing work from this ticket

Thanks, @Jpita. By looking at the new ticket (T237607) and the checklist above ( T232372#5582887 ) it may not be clear which are the aspects that still need to be supported/verified. Can you copy the relevant items from the checklist to the new ticket? In that way it may be easier to make sure that all pending aspects are covered.
Thanks!

Done