Make language slug available via session metadata #1630
+22
−4
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
Jira Ticket
Associated commcare-core PR
This is the formplayer side of the changes. All this code does is ensures that
EntityScreenContext
has the right locale (a string) value provided on initialization and a null value for any instance that's not directly related to the workflow kicked off by anavigateSessionWithAuth
request. Because this process continually recreates the context object, its the ideal entry point to insert this value which will be propagated to the eventualgenerateRoot
function (actual code surrounding this part and further explanation will be in the commcare-core PR).To be complete this PR also covers an instance of
ExternalDataInstance
initialization that will now optionally accept a locale argument.Safety Assurance
Safety story
This shouldn't impact existing data since the
EntityScreenContext
object is constantly being recreated with updated information and most of the time the locale value will be 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