Skip to content

feat: update language setting code to prioritize session language when available#1032

Open
jpagh wants to merge 3 commits intoSuffolkLITLab:mainfrom
jpagh:session-language
Open

feat: update language setting code to prioritize session language when available#1032
jpagh wants to merge 3 commits intoSuffolkLITLab:mainfrom
jpagh:session-language

Conversation

@jpagh
Copy link
Contributor

@jpagh jpagh commented Mar 21, 2026

As discussed with @nonprofittechy , this commit (9c6a08c) checks the session_local special variable for a language value before checking the interview-wide al_user_language.

This commit (73d3eae) updates the event that the language dropdown calls so that the user's chosen language is stored in the session_local.

These together allows individual users to have a language selection that is unique to their session and doesn't change the interview-wide al_user_language.

If an interview is sent via URL then that still changes the interview-wide al_user_language.

Copy link
Contributor

@BryceStevenWilley BryceStevenWilley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These together allows individual users to have a language selection that is unique to their session and doesn't change the interview-wide al_user_language.

I think I need some more explanation of why a user would want this behavior, and why it should be the default. Is it when a user and an advocate are sharing a session, both filling out answers back and forth?

Assuming @nonprofittechy knows more about this use case.

@jpagh
Copy link
Contributor Author

jpagh commented Mar 23, 2026

@BryceStevenWilley You're right, this was based on a discussion with @nonprofittechy and the desire to upstream this change into AL which would keep our initial blocks cleaner.

The use case is particularly multi-user interviews where the users need different languages at the same time, as this ensures that each user's preferred language is applied to only the screens that they see, even when the users are simultaneously using the interview.

@nonprofittechy
Copy link
Member

I think I need some more explanation of why a user would want this behavior, and why it should be the default. Is it when a user and an advocate are sharing a session, both filling out answers back and forth?

@BryceStevenWilley yes, I suggested Jack make this change upstream for code we'll probably share back to AL core to handle multiple signers in an arbitrary order.

Each signer might have their own unique language, and if they're both operating on the interview at the same time, without this, you get a situation where the language changes for the opposing user.

This fits best upstream because language changes need to happen in an initial block. Docassemble doesn't handle multiple initial blocks setting the same variables cleanly. I think to get this to work right now in the interview Jack is developing, he had to add the initial block twice--at the top of the YAML and then again after the imports.

The other option would be to turn off the existing AL initial block altogether and maintain our own for this interview, but I think this could be helpful for any multiuser interview, whether just advocate/client or multiple signers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants