Page MenuHomePhabricator

Special:BrowseData: boolean filter has troubles with German labels (shows both "Yes" instead of "Yes" and "No")
Closed, DeclinedPublic

Description

Whenever I use SemanticDrilldown on German Wikis the filter-option for boolean properties is both "Ja" (Yes) instead of "Ja" / "Nein."

grafik.png (61×184 px, 2 KB)

My workaround is to use a filter of type=text

Event Timeline

m-art-in renamed this task from Special:BrowseData: Boolean Filter Error with German labels to Special:BrowseData: boolean filter has troubles with German labels .Sep 27 2017, 12:51 PM
m-art-in triaged this task as Low priority.
Aklapper renamed this task from Special:BrowseData: boolean filter has troubles with German labels to Special:BrowseData: boolean filter has troubles with German labels (shows both "Yes" instead of "Yes" and "No").Sep 27 2017, 4:39 PM
Aklapper removed a project: PostgreSQL.

Hmm. I cannot find that string in /SemanticDrilldown/i18n/de.json so I'm wondering where it comes from. Could you open that page by appending ?uselang=qqx as a URL parameter (or &uselang=qqx if your URL already includes a ?), so you could get the raw names of those two strings?

Semantic Drilldown uses the Semantic MediaWiki messages "smw_true_words" and "smw_false_words" for these:

https://phabricator.wikimedia.org/diffusion/ESDD/browse/master/includes/SD_Utils.php$406

It uses the 3rd value in the list, which for German looks like it should be "ja" and "nein":

https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/de.json#L122

I don't know why it's giving that output, though. If you change "$bool_value == true" on that line of SD_Utils.php I linked to to "$bool_value === true", does that change the output?

Sorry for the late reply.

If you change "$bool_value == true" on that line of SD_Utils.php I linked to to "$bool_value === true", does that change the output?

Result: it changed from "Ja", "Ja" to "Nein", "Nein". So I withdraw the code.
Any ideas?

Could you add a line like:

print "$bool_value. ";

...below that line, to see what this value is?

Thank you for the fast answer!
return value is "f" "t"

I changed line 406 from

$words_field_name = ( $bool_value == true ) ? 'smw_true_words' : 'smw_false_words';

to

$words_field_name = ( $bool_value == "t" ) ? 'smw_true_words' : 'smw_false_words';

then the result is fine. Maybe something like his would be nicer:

$words_field_name = ( $bool_value == "t" OR  $bool_value == "true") ? 'smw_true_words' : 'smw_false_words';

Strange that nobody else had this issue before. Maybe there are only few non-english Drilldown-users or there is again some irregularities with PostgreSQL, like the issue with YEAR() I had before. But at end of the year we will migrate to MariaDB, too.

Aklapper added a subscriber: Yaron_Koren.

This task has been assigned to the same task owner for more than two years. Resetting task assignee due to inactivity, to decrease task cookie-licking and to get a slightly more realistic overview of plans. Please feel free to assign this task to yourself again if you still realistically work or plan to work on this task - it would be welcome!

For tips how to manage individual work in Phabricator (noisy notifications, lists of task, etc.), see https://phabricator.wikimedia.org/T228575#6237124 for available options.
(For the records, two emails were sent to assignee addresses before resetting assignees. See T228575 for more info and for potential feedback. Thanks!)