feat: role based translations#1649
Open
Scott-James-Hurley wants to merge 8 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref: UserOfficeProject/issue-tracker#1519
Motivation
Another facility at STFC would like to use the Xpress functionality but need uses of the term "technique" to be changed to "facility". ISIS would like to retain the use of the term "technique", so a way to change translations for different users is needed.
How It Works
The first tag associated with the user's current role (we're assuming the role only has one tag) is used to determine what translation to use for the term "technique". A nested object in the translation file with the same name as the tag allows the correct translation to be used.
For example, given tag,name = CLF
and the following in translation.json:
The term "Technique" will be translated to "Facility"
This PR introduces a new environment variable to point to the translation file in the backend. If it's not set, it could cause the "Technique" column header in the technique proposals export to appear incorrectly.
How Has This Been Tested
Tested manually
Changes