Page MenuHomePhabricator

Translation of Page display title in the Special:PageMigration (does not shown field for first translation unit)
Closed, ResolvedPublic

Description

There is a problem with the 'Special:PageMigration', relating to the translation page titles. This problem has existed since the start of this tool.

In the normal mode (with Page title translation is available), Special:PageMigration do not shown field for Page display title:

pasted_file (589×1 px, 148 KB)

If translation of page title is disabled, Special:PageMigration do not shown also field for first translation unit:

pasted_file (600×1 px, 139 KB)

This behavior is annoyed permanently.

Proposal:

  • Add field for filling 'Page display title' translation (this value may be imported, if in migrated page was used {{PAGEDISPLAYTITLE}} magic word, and also in some other cases);
  • show/hide this field depending on related translatable page setting ('Allow translation of page title');
  • improve error that causes this setting to affect the first item

Event Timeline

Aklapper renamed this task from Translation of Page display title in the Special:PageMigration to Translation of Page display title in the Special:PageMigration (does not shown field for first translation unit).Jul 7 2016, 9:58 AM
Nikerabbit triaged this task as Medium priority.Jul 7 2016, 12:04 PM
Nikerabbit moved this task from Backlog to page migration on the MediaWiki-extensions-Translate board.

So if I understand this correctly, you are asking for a field where to place the translated title.

  1. Feature request - field where to place the translated title.
  2. Bugreport - for translatable pages with disabled title translation, Special:PageMigration currently is hide _first_ translation unit

Maybe (1) leads to fix (2) automatically. But maybe not a leads...

Thanks for the testing.

Bugreport - for translatable pages with disabled title translation, Special:PageMigration currently is hide _first_ translation unit

This should definitely be fixed and would be high priority if such pages weren't rather rare.

As for the feature request, I find a limited benefit in it because in most cases the title will need to be filled manually, if at all, as you can already do in Special:Translate itself. But it's ok to have an additional text area if that helps fixing the bug.

Reported here today.
Is there a way to show all the translation units if the title translation is disabled? Shouldn't there be some code that tells if it is enabled or disabled? If there is, can it be used to determine if the first translation unit should be hidden or not?

Kaganer updated the task description. (Show Details)

This should definitely be fixed and would be high priority if such pages weren't rather rare.

@Nemo_bis - this is for all templates, as example... And generally for many includable subpages.

@Nemo_bis I think I found source of the problem. ext.translate.special.pagemigration.js#L145 for loop in getSourceUnits function starts from 1, but arrays are zero-based so it will always skip first translation unit, whether it is displayTitle or regular one, resulting in mentioned bug.

Changing it to i = 0 fixes the problem and also adds a field for translating title as part of feature request.
If page was translated with option Allow translation of page title, unit for pageTitle will be loaded so user can fill it manually or add empty unit an leave it like that for future Special:Translate. The problem could be that there will be no information that it is title but it should be obvious or mentioned in docs for now.

@Nikerabbit
After this fix, third point in Help:Extension:Translate/Page_translation_administration#Tips will need adjustments. Not sure if this should be added as a separate task.

@Kaganer

Maybe (1) leads to fix (2) automatically. But maybe not a leads...

Actually fix from (2) leads to (1) ;)

@Goraf Your explanation of this seems to be right. Do you have any plans to continue working on this? Maybe to provide a patch?

@Phantom42, I have no environment set for this right now. Feel free to take it. I already did what I could

Okay. Thank you for your work @Goraf! I have tested it once again (changing from 1 to 0 fixes the problem) and will push a patch now.

Change 405534 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[mediawiki/extensions/Translate@master] Fix PageMigration not showing field for first translation unit

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

Change 405534 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Fix PageMigration not showing field for first translation unit

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

Patch in Gerrit got merged long ago. Resolving this task.