Multi-Language Selection in Communities
Problem:
Salesforce communities are multilingual. We all know that. Articles can be translated, pages, cases, the works. However, did you know that the language picker component, standard with communities, ONLY works for guest users?
That’s right if you have an authenticated community and you want users to be able to select their own language on a whim, they can’t. They are forced to view the community in whatever language is selected in their user record.
I get it Salesforce, I see your logic. You think the user will want to see everything in their native language. I’m sure most do. But there are A LOT of users across the world that are bilingual and actually prefer to view some things in one language and others in a different one.
Yes, you can use the settings in the profile, but that didn’t work for what we wanted to do. We wanted to leverage this across various pages. We also have integrations that break if the user changes some of their settings themselves. It’s a delicate process. But mainly, we just want a solution to add to any page we wish.
Solution:
Ok, so what are we to do to solve this? Well, one way to go about it is making a lighting component. Sure it’s a small piece of code that might not be hard to maintain. But it’s still rather cumbersome to change, especially if you don’t have an onsite developer or if you’re adding languages.
I recommend an easier way. It’s so simple, in fact, that I should have thought of it years ago when I first encountered this issue.
JUST. USE. A. SCREEN. FLOW. IN. FLOW. BUILDER.
Yes, it’s really that simple.
Steps:
- Edit your community profiles to allow them to run flows
- Create the screen flow. Use a picklist of choices to select.
- User a decision to determine what language was selected and what to set it to. This is important because selecting “French” would need the language field to be set to “fr” and not the actual full word for example.
- Add the flow component, with your newly activated flow, to your community.
- Publish the community
- *Here’s a side note, if you need to make a minor edit to the flow, like adding some text. You can add it and activate the flow without ever having to republish the community.