Page MenuHomePhabricator

[8h] Dynamically change the survey question based on the project domain
Closed, ResolvedPublicSpike

Description

Background information

We would like to dynamically change the survey title based on project domain. If the project is a Wikipedia project we would like to also include the URL of said project, here's an example

In the last 30 days, have you felt unsafe or uncomfortable contributing to Wikipedia (en.wikipedia.org)?

If the project is a non-wikipedia project we would like to omit the URL, here's an example

In the last 30 days, have you felt unsafe or uncomfortable contributing to Wikimedia Commons?

With a combination of Magic Words and Parsers Functions we are able to dynamically change the question based on the {{SITENAME}} with the following code

In the last 30 days, have you felt unsafe or uncomfortable contributing to {{SITENAME}}{{#ifeq: Wikipedia | {{SITENAME}} | <nowiki> </nowiki>({{SERVERNAME}})}}?

but unfortunately this method isn't working for Wikipedias that set their site name in a non-latin alphabet, if there are diacritics (eg. Portuguese Wikipedia is "Wikipédia") and if grammatical case changes for the word Wikipedia (for example in Polish "Wikipedii" is a possibility) - anything where the exact output isn't "Wikipedia". For example @TAndic tested this on Serbian Wikipedia and the output does not include the {{SERVERNAME}} as intended

In the last 30 days, have you felt unsafe or uncomfortable contributing to Википедија?

Questions

  • Is it possible to have a message where:
    • Wikipedia projects show {{SITENAME}} ({{SERVERNAME}})
    • Non Wikipedia projects show {{SITENAME}} (Commons, Wikidata, Mediawiki, etc.)
  • If so, how?

Answer: Yes it is possible, by specifically listing the wikis where you want {{SITENAME}} only, and defaulting the rest of wikis to {{SITENAME}} ({{SERVERNAME}}) like this:

{{SITENAME}}{{#switch: {{SITENAME}} | Wikimedia Commons | Wikidata | Meta = | #default = <nowiki> </nowiki>({{SERVERNAME}})}}

Examples:

Event Timeline

Jhernandez renamed this task from Dynamically change the survey question based on the project domain to SPIKE: Dynamically change the survey question based on the project domain.Nov 16 2021, 5:13 PM
Jhernandez added a project: Spike.
Jhernandez updated the task description. (Show Details)

and if grammatical case changes for the word Wikipedia

I'm not sure if https://translatewiki.net/wiki/Grammar has been brought up, so I'll throw it in just FYI.

  • Non Wikipedia projects show {{SITENAME}} (Commons, Wikidata, Mediawiki, etc.)

That does not seem to cover cases like fr.wikiversity.org or ar.wiktionary.org, but maybe that's intentional?

@Aklapper you are correct, though it is not intentional! In the current survey, we won't be able to get into wiktionary or wikiversity spaces due to their smaller editor counts so it should not affect us, but it could be something that comes back to us years down the line. The most inclusive way to write this that I could think of would be to say if = Commons, Wikidata, Mediawiki, or other unique site names, then don't include {{SERVERNAME}} rather than the other way around, but I'm not sure if that's possible?

AAlhazwani-WMF changed the subtype of this task from "Spike" to "Task".Nov 17 2021, 1:28 PM
Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptNov 17 2021, 1:28 PM

(@aminalhazwani: For the records, that task subtype change was reverted because of the existing Spike project tag on this task.)

(Thanks for the clarification @Aklapper! We are thinking about using only tags instead of task suptype and/or title prefixes because it results in unnecessary information redundancy. For future tasks, is it possible to exclude these automations?)

A couple of links for things that might be useful in this exploration:

AAlhazwani-WMF renamed this task from SPIKE: Dynamically change the survey question based on the project domain to SPIKE: Dynamically change the survey question based on the project domain [8H].Nov 17 2021, 3:52 PM
Jhernandez renamed this task from SPIKE: Dynamically change the survey question based on the project domain [8H] to [8h] Dynamically change the survey question based on the project domain.Nov 17 2021, 5:08 PM
Jhernandez changed the task status from Open to In Progress.
Jhernandez claimed this task.

@TAndic @aminalhazwani what are the sites you would want to show only the site name? Commons and Wikidata? If they are the only two then it will be easier to check for those two for special treatment and leave {{SITENAME}} ({{SERVERNAME}}) for the rest.

The StringFunctions parser functions that would be very useful for doing partial checks against the SERVERNAME are disabled in all production wikis. So that avenue is a no-go

Also possibly useful, the variable {{CONTENTLANGUAGE}} contains the main language of the wiki, so instead of SERVERNAME that one could be used for a shorter message:

In the last 30 days, have you felt unsafe or uncomfortable contributing to Wikipedia (en)?

It is also possible to get the localized language name, with {{#language:{{CONTENTLANGUAGE}}}}, for something like this:

In the last 30 days, have you felt unsafe or uncomfortable contributing to Wikipedia (English)?

In russian:

In the last 30 days, have you felt unsafe or uncomfortable contributing to Википедия (русский)!

Keep in mind even if the language is translated you can't make a sentence like:

In the last 30 days, have you felt unsafe or uncomfortable contributing to English Wikipedia?

Although tempting, this doesn't translate at all to other languages, where the language may be a gendered adjective or need other prepositions or language forms, for example in Spanish Wikipedia (español) can't be made español Wikipedia or Wikipedia español, would need to be Wikipedia española or Wikipedia en español.

Any of these changes when translating would be extremely challenging to get right given the wikitext involved, and maybe even impossible in some languages

In the last 30 days, have you felt unsafe or uncomfortable contributing to {{SITENAME}}{{#switch: {{SITENAME}} | Wikimedia Commons | Wikidata = | #default = <nowiki> </nowiki>({{#language:{{CONTENTLANGUAGE}}}})}}?

Thanks for this @Jhernandez !

The sites we don't want a URL with are Wikidata, Commons, and potentially Meta, but we are very very unlikely to get to surveying on Meta any time in the next year or longer. (That I suppose is a question of "Do we include it now just in case, or is it possible to add later?")

For all of the language-specific projects, I would be happy with either {{SERVERNAME}} or using {{CONTENTLANGUAGE}} to generate "(en)". {{SERVERNAME}} to me seems to imply zero ambiguity about which site we mean, but I could be wrong.

Aligned with your concerns, I wouldn't want to attempt working with the full language word in text (ie. "English" "русский") and possibly even just in parentheses; my gut feeling is that it could introduce ambiguity without our knowledge and I worry about risking this working with languages we don't all speak. I am, of course, willing to be convinced otherwise for the parentheses if we can get some confirmations!

That I suppose is a question of "Do we include it now just in case, or is it possible to add later?"

The messages are easily edited so I think it is better to keep them specific to whatever we are doing at this point. Less complexity for translators.

For all of the language-specific projects, I would be happy with either {{SERVERNAME}} or using {{CONTENTLANGUAGE}} to generate "(en)". {{SERVERNAME}} to me seems to imply zero ambiguity about which site we mean, but I could be wrong.

Aligned with your concerns, I wouldn't want to attempt working with the full language word in text (ie. "English" "русский") and possibly even just in parentheses; my gut feeling is that it could introduce ambiguity without our knowledge and I worry about risking this working with languages we don't all speak. I am, of course, willing to be convinced otherwise for the parentheses if we can get some confirmations!

Sounds good! Just outlining some of the things I found that could be useful in this context 👍

In T295751#7513889, @aminalhazwani wrote:

During design review Pau shared with me this list of translations in natural language https://translatewiki.net/w/i.php?title=Special:Translate&group=ext-wikimediaprojectnames&language=es&filter=&optional=1&action=translate. Is this something useful for us?

Not immediately relevant to the current investigation, maybe if the question ends up being different per wiki

Jhernandez added a subscriber: Madalina.

@aminalhazwani @Madalina I've reached the timebox (approximately) and I've listed the only solution I could find in the description.

  • Is that answer enough?
    • Yes: Move to Signoff to resolve
    • No: How should we proceed? Any follow up questions? What is the new timebox?

+1 for moving to signoff. In the meantime I share an update on the parent task T294556: Safety Survey Content and EN Strings.

I think we got the information we were looking for, let's move this to signoff