Page MenuHomePhabricator

qqq for a wiki-ai message cannot be loaded
Closed, ResolvedPublic

Description

When I go to https://translatewiki.net/wiki/Special:Translate?filter=&action=translate&group=wiki-ai and click on the first message, the qqq for it cannot be loaded. It gets stuck at “Loading...”.

This may or may not be related to its unusual key: Wikimedia:Wiki-ai-wikilabels-'$1' not completed. Submit anyway?/he.

Related Objects

Event Timeline

Amire80 created this task.Apr 8 2016, 6:00 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 8 2016, 6:00 PM

{"error":{"code":"nomessagefortitle","info":"Title does not correspond to a translatable message","*":"See https://translatewiki.net/w/api.php for API usage"}}

Maybe the quotes...but the editor should fail properly.

Halfak added a comment.Apr 9 2016, 4:22 PM

The key contains the same content as the english message. See https://github.com/wiki-ai/wikilabels/blob/master/wikilabels/i18n/en.json#L3

"'$1' not completed. Submit anyway?"

Are there some characters that are not appropriate for the key? Given that JSON keys are arbitrary strings, it seems like this is a bug in translatewiki.

Nikerabbit triaged this task as Medium priority.Apr 20 2016, 1:17 PM

Given this only affects few or one message, not giving high priority. Should still check whether it is an easy fix.

Nikerabbit added a comment.EditedApr 10 2017, 8:01 AM

This was reported again elsewhere. The issue is that the key has two consecutive spaces, and MediaWiki does not support that. I really recommend you to change the message key.

Zache added a subscriber: Zache.Apr 10 2017, 9:18 AM

@Nikerabbit, shouldn't any valid JSON object key be valid? It seems like you're proposing a work-around, but not a fix. What would need to be fixed to make this work-around not necessary?

There is no fix, only work-arounds. MediaWiki limits what page titles are valid. I believe that it is far easier for you to remove one space from the message key than me to implement a message key rewriting code that

  • might be slow
  • is likely to be complicated due to complex rules what is a valid title and what is not
  • will take us further from the 1:1 to mapping between page title and the real message key in the files

If you would like to attempt implementing this, a good place to start would be FileBasedMessageGroup::load (or StringMangler::mangleString, but I feel that code should rather be moved away from the mangler). This solution is not a high priority issue to me.

MediaWiki limits what page titles are valid.

I see. So all message keys must be render-able as a page title in MediaWiki? I guess that's the complicating part of this.

Stryn added a subscriber: Stryn.Apr 10 2017, 4:01 PM

MediaWiki limits what page titles are valid.

I see. So all message keys must be render-able as a page title in MediaWiki? I guess that's the complicating part of this.

Correct.

Halfak claimed this task.Apr 13 2017, 11:21 PM
Halfak closed this task as Resolved.Apr 14 2017, 5:42 PM
LNDDYL added a subscriber: LNDDYL.Apr 17 2017, 6:53 AM