Skip to content

feat: role based translations#1649

Open
Scott-James-Hurley wants to merge 8 commits into
developfrom
1519_dynamic_translations
Open

feat: role based translations#1649
Scott-James-Hurley wants to merge 8 commits into
developfrom
1519_dynamic_translations

Conversation

@Scott-James-Hurley

Copy link
Copy Markdown
Contributor

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:

"CLF": {
    "Technique": "Facility"
}

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

  • Adds i18n to backend
  • Adds tags associated with roles in user context
  • Translation added for "Technique" header name for technique proposals spreadsheet export
  • Translation added for instances of "Technique" on technique proposals page

@Scott-James-Hurley Scott-James-Hurley added enhancement New feature or request review: please breaking:change A change that could disrupt external dependencies labels Jul 16, 2026
@Scott-James-Hurley
Scott-James-Hurley marked this pull request as ready for review July 17, 2026 12:27
@Scott-James-Hurley
Scott-James-Hurley requested a review from a team as a code owner July 17, 2026 12:27
@Scott-James-Hurley
Scott-James-Hurley requested review from ACLay and removed request for a team July 17, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking:change A change that could disrupt external dependencies enhancement New feature or request review: please

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant