Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Preference: Implementing Translations in FEM #3656

Open
goplayoutside3 opened this issue Sep 9, 2021 · 1 comment
Open

Language Preference: Implementing Translations in FEM #3656

goplayoutside3 opened this issue Sep 9, 2021 · 1 comment

Comments

@goplayoutside3
Copy link

Currently PFE implementation of language preference does not persist between sessions. There's at least one issue open because volunteers would prefer to keep their language preference when the browser is refreshed (Example project: Every Name Counts Issue #5729).

While building language translations for FEM, we have the opportunity to implement persistent language preference between sessions. I'm opening an issue here for discussion of two questions:

  1. Should the language preference be loaded from panoptes via request, or loaded from a cookie?
  2. If language preference is fetched from panoptes, will it be stored on the User resource, or some other location?
@camallen
Copy link
Contributor

The User model has an array attribute to store the preferred languages strings of an individual volunteer,

languages character varying[] DEFAULT '{}'::character varying[] NOT NULL,

https://panoptes.docs.apiary.io/#reference/user/user

This setting is used as a persisted API side setting to ensure the user is presented with content in their desired language,

api_user.try(:languages) || []

You can use this attribute to provide a list of preferred languages, e.g. 'es, it, he, en-gb' which can be used to select any known translations that match these preferences (prioritized set intersection) to wire up the UI. See our translations system for local codes https://github.com/zooniverse/pandora/blob/2030aa5992b5586181d0b72b1a80680f7310765f/src/constants/languages.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants