Language filters use 'All' as language code
Closed, ResolvedPublic

Description

Changes to

Note the change "All" to "all"

Also, at this point the html for the filter is

<div class="cx-language-filter-button" dir="ltr" lang="All">all</div>

The reason for this is, unconditional usage of language code without checking if it is "All" in mw.cx.ui.LanguageFilter.prototype.setFilterLabel

mw.language.bcp47('All')
> "all"
santhosh created this task.Dec 15 2017, 5:06 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 15 2017, 5:06 AM

Change 398610 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Use uppercase "All" language code on smaller screens

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

Alright, I have submitted a patch that doesn't make "All" pseudo language code go through bcp47, effectively making it stay uppercase.
Here is a comparison on how it looks with autonym language names vs language codes when screen gets smaller. I find that using uppercase only for "All" makes it look unbalanced.

Autonym namesLanguage codes

@Pginer-WMF, any thoughts on this?

I find that using uppercase only for "All" makes it look unbalanced

Note that the label "All" will be translated to other languages where sometimes there is no upper case and lower case.

Note that the label "All" will be translated to other languages where sometimes there is no upper case and lower case.

The reason why previous message "From/To any language" was changed to "All" is to save space on smaller screens - T175010. And we aren't doing it right with the current approach. Localized messages can be much longer than three characters. And English version has two L letters (which are slim), making the whole text fit on really small devices.

Since we use language codes in Latin script on smaller screens anyway (shown in screenshot below), I think we should go with all pseudo language code on small screens for this special case, and keep the localized message on larger screens.

The problem with generated HTML (example in ticket description) should be fixed, of course.

Here are screenshots from CX with Hebrew as UI language:

English to AllAll language codes use Latin script

I don't think we should expose users with an artificial language code to represents all languages. Using the translated version of the word "all" seems more intuitive. That is, in Greek it will display "Όλα", and in Baque it will be "Guztiak". We can do this in both small and larger screens. For small screens it is ok if the text gets cropped with ellipsis if it becomes too long, but checking the translations that seems to be the exception.

Note that the label "All" will be translated to other languages where sometimes there is no upper case and lower case.

The reason why previous message "From/To any language" was changed to "All" is to save space on smaller screens - T175010. And we aren't doing it right with the current approach. Localized messages can be much longer than three characters. And English version has two L letters (which are slim), making the whole text fit on really small devices.

The longest I could find is six, but it's already a bit of a problem. For example, in Chechen, where "Ерриге" is shortened to "Ерр...".

Since we use language codes in Latin script on smaller screens anyway (shown in screenshot below), I think we should go with all pseudo language code on small screens for this special case, and keep the localized message on larger screens.

... Despite the length problem, if there's no choice, it's better to show a word with ellipsis than to show an English word. A shorter translated word is more likely to be understood than an English word.

For small screens it is ok if the text gets cropped with ellipsis if it becomes too long, but checking the translations that seems to be the exception.

It is actually this message.

Thank you @Amire80 and @Pginer-WMF for your inputs and for taking my suggestion into consideration. It is already working as described, with the submitted patch set to deal with HTML problems reported in the description of this ticket. We may only need to optimize for longer localized messages.

Change 398610 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Don't use directionality and autonym with "All" language code

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

Checked in cx-testing - 'All' does not change to lower case and the longer translation for all looks satisfactory:

Etonkovidova closed this task as Resolved.Jan 2 2018, 3:29 AM
Nikerabbit moved this task from QA to Done on the Language-2017-Oct-Dec board.Jan 2 2018, 6:58 AM