Page MenuHomePhabricator

Export in native format on Special:ExportTranslations results in an empty .json file if messages do not exist
Closed, ResolvedPublic4 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to Special:Translate
  • Click on 'Export', among the links on the the top right corner of the page which opens Special:ExportTranslations
  • Select the Mobile Frontend - User interface group from dropdown menu
  • Select a language to export such as Kikuyu - ki
  • Select 'Export in native format'
  • Finally, click on 'Fetch'

Screen Shot 2023-03-30 at 08.42.56 AM.png (402×1 px, 36 KB)

What happens?:
A .json file is downloaded. Opening the .json file may* reveal that the file is empty if the message group contains no messages to export.

What should have happened instead
If the group selected contains no messages to be translated in the selected language an error message should be displayed to the user notifying them so.

Event Timeline

Wangombe renamed this task from Export in native format on Special:ExportTranslations results in an empty .json file to Export in native format on Special:ExportTranslations results in an empty .json file if messages do not exist.Mar 13 2023, 6:44 AM
Nikerabbit updated the task description. (Show Details)
Nikerabbit moved this task from Backlog to tux on the MediaWiki-extensions-Translate board.

I tried to replicate the issue:

  1. went to Special:Translate;
  2. clicked on Export, which took me to Special:ExportTranslations;
  3. selected a group, namely Help:Authority control;
  4. selected a language, namely Croatian (hr);
  5. selected Export in native format;
  6. pressed Fetch;

but I got an error message about the specified export format not being supported, not an empty JSON file. Please be more precise.

I tried to replicate the issue:
...
but I got an error message about the specified export format not being supported, not an empty JSON file. Please be more precise.

I think an error message would be more appropriate to display instead of downloading a file with 'empty' json content.

Wangombe set the point value for this task to 4.Apr 4 2023, 8:06 AM

After some investigation, this seems to only occur for message groups that are FileBasedMessageGroup::class instance. The error message about "the specified export format not being supported", Should appear where the message group being exported is not an instance of FileBasedMessageGroup.

Nikerabbit lowered the priority of this task from Low to Lowest.Apr 4 2023, 12:06 PM
Wangombe changed the task status from Open to In Progress.Apr 18 2023, 7:23 AM
Wangombe claimed this task.

Change 909986 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Special:ExportTranslations show error message if empty

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

image.png (503×1 px, 30 KB)
Here is the output using the DiscordWikiBot and a language that the messages don't exist in, ki.

Change 909986 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Special:ExportTranslations: Show error message if nothing to export

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

Tested on translatewiki.net