Make language slug available via session metadata (formplayer branch) #1441
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.
Product Description
Users will now be able to reference the current language slug (i.e. 'en', 'es', etc.) on the screen by referencing
instance('commcaresession')/session/context/applanguage
Technical Summary
Associated formplayer PR
This is the commcare-core side of the changes which:
EntityScreenContext
class to be able to carry and get the stored locale value (first initialized from withinnavigateSessionWithAuth
), which allows it to be accessed during different parts of the response creation process.generateRoot
path such thatlocale
is eventually added to the session root under metadata.setupSessionData
, which eventually leads to callingaddMetadata
, now also with a required 'locale' arguement.navigateSessionWithAuth
request to use null values instead).Safety Assurance
Safety story
This shouldn't impact existing data since the objects surrounding session context is constantly being recreated with updated information from formplayer and most of the time the
locale
value will be set to null.QA Plan
No plans for QA but will have delivery (who request this feature) do some testing to ensure it's doing what they want.
Special deploy instructions
Rollback instructions
Review
Duplicate PR
Automatically duplicate this PR as defined in contributing.md.
(Doing this after this PR gets approved)