Page MenuHomePhabricator

Interaction Timeline should let me choose a language
Open, MediumPublic3 Estimated Story Points

Description

Right now there's no way for me to change the language I see the interaction timeline in without changing the language of my browser. If my language is not well-supported and the localization of my browser in my language is poor or nonexistent, or if I'm using a shared browser, I should still be able to select my language.

There should be a language selector on the page; see e.g. the top-right corner of https://tools.wmflabs.org/pageviews/

Event Timeline

You might also consider supporting a uselang= URL parameter to change the language. I think that's more for sharing URLs. See T171015 for equivalent request for Pageviews Analysis.

It seems that the consensus view is that a language picker should exist on the page, but the default should be inferred from the browser's settings. Also, this preference should be stored in LocalStorage so it is persisted the next time the user visits the page.

It seems that the consensus view is that a language picker should exist on the page, but the default should be inferred from the browser's settings

This is how most tools do it. Again the use case is somewhat less common, but a way to change the language via a URL parameter would be good too.

Also, this preference should be stored in LocalStorage so it is persisted the next time the user visits the page.

If you want, you could instead use the TsIntuition_userlang (language code) and TsIntuition_expiry (UNIX timestamp) cookies, which are used by the Intuition i18n framework. If you use their cookies, the language preference will carry over to the many other tools on tools.wmflabs.org that use Intuition.

If you want, you could instead use the TsIntuition_userlang (language code) and TsIntuition_expiry (UNIX timestamp) cookies, which are used by the Intuition i18n framework. If you use their cookies, the language preference will carry over to the many other tools on tools.wmflabs.org that use Intuition.

If I remember correctly we are handling translations on the client side of the app so we can't use Intuition. We could use the cookie if it exists but then we'll be considering something that is not part of our dependencies. I think that https://phabricator.wikimedia.org/T189839#4485397 is the way to go for now.

If I remember correctly we are handling translations on the client side of the app so we can't use Intuition. We could use the cookie if it exists but then we'll be considering something that is not part of our dependencies. I think that https://phabricator.wikimedia.org/T189839#4485397 is the way to go for now.

Yes it's all handled on the client. If the cookie is not httpOnly then we could use/set the cookie instead of using LocalStorage.

If we are gonna set that cookie we somehow need to inform the user that language selection is shared among the tools in the domain. Otherwise it is an unexpected side-effect to select a language in one tool and have it carried over to another.

If we are gonna set that cookie we somehow need to inform the user that language selection is shared among the tools in the domain. Otherwise it is an unexpected side-effect to select a language in one tool and have it carried over to another.

What do other tools do?

If we are gonna set that cookie we somehow need to inform the user that language selection is shared among the tools in the domain. Otherwise it is an unexpected side-effect to select a language in one tool and have it carried over to another.

What do other tools do?

I have no idea

If we are gonna set that cookie we somehow need to inform the user that language selection is shared among the tools in the domain. Otherwise it is an unexpected side-effect to select a language in one tool and have it carried over to another.

That is the point, I thought. There are numerous tools that use Intuition, or it's cookies. At the least it probably won't be of any surprise if the user sees other tools in the language they selected.

That is the point, I thought. There are numerous tools that use Intuition, or it's cookies. At the least it probably won't be of any surprise if the user sees other tools in the language they selected.

Yeah if other tools use/set the cookie (assuming it's not httpOnly) then I think it's fine if we do the same.

Niharika set the point value for this task to 3.