Page MenuHomePhabricator

Open references with specific dialog
Closed, InvalidPublic

Description

Currently in Section Translation, references based on a common template such as Cite Web are opened with the generic dialog for references. This requires two steps for editing the reference: opening the reference first and then opening the template.

This example sequence shows the steps:

sx.wmflabs.org_index.php_Special_ContentTranslation_page=Moon&from=en&to=es&sx=true(iPhone 5_SE).png (1×640 px, 90 KB)
sx.wmflabs.org_index.php_Special_ContentTranslation_page=Moon&from=en&to=es&sx=true(iPhone 5_SE) (1).png (1×640 px, 121 KB)
sx.wmflabs.org_index.php_Special_ContentTranslation_page=Moon&from=en&to=es&sx=true(iPhone 5_SE) (2).png (1×640 px, 71 KB)

This issue does not happen when using Visual Editor (mobile or desktop) directly. There the specific template dialog is opened directly.

A similar issue occurs in Content Translation as a regression. This was originally supported at T199512, but a regression makes it show both options on the desktop editor right now (T232330). Based on comments (T199512#4570362) this seemed related to the integration of Citoid.


I used as an example the translation of the "Formation" section of the Moon article from English to Spanish using Google Translate (example link).

Event Timeline

santhosh added a subscriber: santhosh.

The support for specific dialogs in VE for Web, Journal, Book etc are implemented is based on content language. The mapping of template names(which varies per language) to corresponding tool in VE is done by a message cite-tool-definition.json and visualeditor-cite-tool-definition.jsonwhich has json as content. We can see it by running JSON.parse(mw.message( 'cite-tool-definition.json' ).plain()) in browser dev tool. For Spanish content language, it will look like

[
  {
    "name": "web",
    "icon": "ref-cite-web",
    "template": "Cita web",
    "title": "Sitio web"
  },
  {
    "name": "news",
    "icon": "ref-cite-news",
    "template": "Cita noticia",
    "title": "Noticias"
  },
  {
    "name": "book",
    "icon": "ref-cite-book",
    "template": "Cita libro",
    "title": "Libro"
  },
  {
    "name": "journal",
    "icon": "ref-cite-journal",
    "template": "Cita publicación",
    "title": "Diario"
  }
]

But if we run the same in test.wiki, we will get mapping for English template names

So the behavior is tightly coupled with content language. Testwiki cannot be used for testing this behavior for any language other than English.

In my testing with a wiki with es as content language, I am seeting expected behavior. Screenshots given below:
(The issue of empty content for reference card is something different {T286788: Reference card is initially shown empty in Section translation}, ignore it for now)

image.png (953×616 px, 38 KB)
image.png (953×616 px, 50 KB)

You can also try it in Bengali wiki: https://bn.m.wikipedia.org/w/index.php?title=Special:ContentTranslation&page=Moon&from=en&to=bn&sx=true#/sx/sx-editor

So, I would recommend closing this ticket as it works as expected.

Etonkovidova added a subscriber: Etonkovidova.

Checked - works as expected. Closing as Invalid .

The support for specific dialogs in VE for Web, Journal, Book etc are implemented is based on content language. The mapping of template names(which varies per language) to corresponding tool in VE is done by a message cite-tool-definition.json and visualeditor-cite-tool-definition.jsonwhich has json as content. We can see it by running JSON.parse(mw.message( 'cite-tool-definition.json' ).plain()) in browser dev tool. For Spanish content language, it will look like

[
  {
    "name": "web",
    "icon": "ref-cite-web",
    "template": "Cita web",
    "title": "Sitio web"
  },
  {
    "name": "news",
    "icon": "ref-cite-news",
    "template": "Cita noticia",
    "title": "Noticias"
  },
  {
    "name": "book",
    "icon": "ref-cite-book",
    "template": "Cita libro",
    "title": "Libro"
  },
  {
    "name": "journal",
    "icon": "ref-cite-journal",
    "template": "Cita publicación",
    "title": "Diario"
  }
]

But if we run the same in test.wiki, we will get mapping for English template names

So the behavior is tightly coupled with content language. Testwiki cannot be used for testing this behavior for any language other than English.

In my testing with a wiki with es as content language, I am seeting expected behavior. [...]

testwiki doesn't have assigned language, so testing some feature there (incl.CX) is limited. I checked eswiki and bnwiki (the link that @santhosh provided) - the CX (desktop) and the section translation differentiate between different types of references, e.g. the example below shows that the Book reference was interpreted correctly for translation from en to bn:

Screen Shot 2021-11-30 at 2.08.13 PM.png (1×3 px, 285 KB)
after a user clicks on Edit (the pencil icon)
Screen Shot 2021-11-30 at 2.08.24 PM.png (1×2 px, 218 KB)