Page MenuHomePhabricator

Language button in article search displays "null" on first use
Closed, ResolvedPublic

Description

  1. Create new account
  2. Enable CX
  3. Go to CX

Observe the language button's label is "null"

Details

Related Gerrit Patches:
mediawiki/extensions/ContentTranslation : masterFix null being used as source language

Event Timeline

Esanders created this task.Aug 20 2018, 2:17 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 20 2018, 2:17 PM

Thank you @Esanders for reporting this.
I saw this error once in some unusual circumstances and wasn't able to reproduce it ever again. When you reported, I decided to look into what causes this problem.

This requires:

  • Content and UI language to be the same (which is usually the case)
  • Browser language same as previous two. Or if some language code unrecognized by ULS is used, like 'en-us'
  • There are no previous ULS languages (easily the case for new and monolingual users)
  • Accepted language list isn't altered. Usually browsers use 'en-us' and 'en' as defaults. In Chrome, you can add more (probably most users don't). Don't know about other browsers
  • Country code is not available

All of the above prerequisites aren't that unusual, especially for new users, who decide to try Content Translation soon after account creation. Probably most affected are new users of wikis where content language is English, because browser language is often also set to English.

We don't have any reasonable info about the user in such case. In the past, this case was resolved to using Spanish as source language. Here are the top languages from which users translate to English:

#TranslationsLanguage
11,365español
21,174français
3741Deutsch
4453italiano
5417português

Given the above analysis, I think we should fallback to Spanish as source language if English is the target language. If some non-English language is used as target, we should fallback to English, as most translation come from English anyway.

@Amire80, do you have other ideas?

Change 455210 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Fix null being used as source language

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

Change 455210 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Fix null being used as source language

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

Arrbee moved this task from Bugs to Check & Move on the ContentTranslation board.Aug 5 2019, 1:18 PM
Petar.petkovic closed this task as Resolved.Aug 5 2019, 2:46 PM
Petar.petkovic claimed this task.
Petar.petkovic moved this task from Check & Move to Bugs on the ContentTranslation board.

This is long resolved, just wasn't closed.