I've built a PowerApp on SharePoint list data and successfully followed this pattern for Building multilingual apps in PowerApps. I have a userLang variable that's set on the first screen of the app. The underlying SharePoint list has data in Finnish language ("fi"), but if the user switches to English ("en"), all the labels in the app screens are retrieved from an Excel table with strings in English. Works great on forms and its data cards, too!
Except for Combo Box fields with data coming from a SharePoint choice column. I haven't found a sensible solution for making the DataCardValue show a different default value if the user wants to see the text in English rather than the native Finnish value that's stored in SharePoint. Also how to save the new choice from the user with English enabled once the form is submitted is something I'm having trouble figuring out. Changing the DataCardValue Items list with an if statement that contains the list strings in different languages seems to work, although it would be nicer to pull all these from the single Excel table with a lookup function like with simple labels (there's probably a way to turn the Value column into a table that Items would accept, but I didn't get that far yet).
Has anyone implemented this multilingual feature for a Combo Box that works with SharePoint choice columns, or come across blogs/videos that would demonstrate a solid pattern to use here? Essentially what I'd want a confirmation on is if it's even a good idea to try and "mask" the strings that a form's data card works with into something completely different on the UI level than what they actually are at the data source.
Did you try a lookup field instead of choice column, so that you can save the Id. The lookup list can contain multiple columns based on laguage (as you already did for other fields).
Based on the language you need to populate only that column.
It's still an interesting piece of information, since in the CDS (XRM) world where I come from, doing multilingual apps is where the lookup field would cause you severe problems. There the right answer would be to use Option Sets, which essentially is the same concept as choice columns in SharePoint lists on a high level. Funny that in SP vs. CDS this label translation issue is actually reversed!
Instead of using the default formula for Items property of the combo box inside Form control, which is Choices(ListName.ColumnName), you can set the options manually with English options. Then update with Patch function instead of SubmitForm. About how to patch multi select choice column in sharepoint, please refer to thread below:
Thanks for this suggestion, Mona! While I've been able to set the available choices for the Combo Box, I can't quite figure out how I would dynamically change the string that is presented to the user while looking at a record which has the choice field already populated with a value (rather than creating a new record). What would be the right property to modify here, to make the Combo Box show a different language text when the form is opened?
About the update process: since this scenario is using a form to display the data, would your suggestion of using patch instead of SubmitForm mean that I should essentially move away from using forms for multilingual apps completely? I guess there isn't a way to selectively submit only a subset of the form fields and do a patch on the ones based on a SharePoint choice columns, so it sounds to me like the form might not provide much added value in this scenario anymore.
Continue your learning in our online communities.
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round
Register by September 5 to save $200