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

remove server side language content loading #3658

Merged
merged 1 commit into from
Sep 16, 2021

Conversation

camallen
Copy link
Contributor

@camallen camallen commented Sep 15, 2021

This PR removes vestigial code that was used to load translated content via user language preferences, e.g. old *Content models that stored translations before the extraction to translations service.

Linked to #3099 and prompted by #3656

All translated content now is handled by the translations service via https://github.com/zooniverse/pandora/

Review checklist

  • First, the most important one: is this PR small enough that you can actually review it? Feel free to just reject a branch if the changes are hard to review due to the length of the diff.
  • If there are any migrations, will they the previous version of the app work correctly after they've been run (e.g. the don't remove columns still known about by ActiveRecord).
  • If anything changed with regards to the public API, are those changes also documented in the apiary.apib file?
  • Are all the changes covered by tests? Think about any possible edge cases that might be left untested.

remove vestigial code that was used to load translated content via user language preferences, e.g. old *Content models that stored translations before the extraction to translations service
@camallen camallen force-pushed the remove-old-translation-language-code branch from 3f018ba to 6385174 Compare September 15, 2021 10:54
@github-actions github-actions bot added the approved Approved pull request label Sep 15, 2021
@yuenmichelle1
Copy link
Collaborator

Not really a comment, more of a question/followup. in response to #3656, the plan is to pull language preference from the User resource via Panoptes and the api will persist the language preference between sessions. did I understand that correctly?

@camallen
Copy link
Contributor Author

Not really a comment, more of a question/followup. in response to #3656, the plan is to pull language preference from the User resource via Panoptes and the api will persist the language preference between sessions. did I understand that correctly?

Yes - basically the User Resource becomes a place to store an individuals language preferences that can then be used to modify the UI translation strings. As the data is stored in the API it's consistent across all sessions the user is logged into our platform.

This persisted language setting can easily be overridden using local / session storage in the unique browser to allow a user to modify the language of a browser by browser basis if that's the sort of behaviour we'd like to offer.

I.e. volunteer is logged in on two browsers and on

  1. Browser 1 they have no local/session store value so uses the user.langages values to wire up the UI
  2. Browser 2 they have a local/session store value set to es to ensure the UI uses Spanish translations where they exist for the UI strings and the custom per project translations content.

@camallen camallen merged commit de4df39 into master Sep 16, 2021
@camallen camallen deleted the remove-old-translation-language-code branch September 16, 2021 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants