TPAC needs a locale picker
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Undecided
|
Unassigned | ||
2.2 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
* Evergreen master / 2.2
There is currently no good way for users to change their preferred locale in TPAC. They can change their browser language preference, but it's cumbersome and almost nobody does, and that's still problematic for shared workstations (like at public libraries). They could also set an eg_locale cookie for the given hostname in their browser, which is even less likely. So we need to provide users with a less painful way to switch locales.
The ideal solution will:
1) Only show the locale picker if multiple locales are available. No sense in cluttering the screen display if there's no choice to be made!
2) Display the list of locales in their localized form (for example, "English (Canada)", "français (Canada)", "español (España)", etc).
3) Make the setting sticky so that the user doesn't have to change their setting each browser session (for example, set the eg_locale cookie expiry time way into the future)
4) Not impact the performance of the TPAC (for example, don't query the database on each page load just to get the translated versions of each locale name; cache that!)
5) Immediately reload the current page without losing any context. For example, if I share a link to a given page of search results, the recipient should be able to pick a different locale and get the same results displayed in their preferred locale.
6) Have a design that is accessible, does not require Javascript, and does not suck. One option might be to, in the absence of any detected locale preference, display a locale selection page (similar to what gc.ca and aircanada.com do), and then tuck the locale picker in a less conspicuous location.
7) Have the locale picker selection default to the currently selected locale.
Towards that end, user/dbs/
Changed in evergreen: | |
status: | New → Fix Committed |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Force-pushed an updated branch that (I think) addresses #2 and #5.
Note that this branch consists of two commits; the last commit simply fixes a problem with the translation parser that meant that any non-ASCII data was getting garbled.
Therefore, please merge the top two commits in user/dbs/ tpac_i18n_ cookie !