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

{"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.

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.

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.

@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.

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.