Forum Discussion
IanKl
Khoros Alumni (Retired)
Ok, final answer, I believe, you need the following to set the user profile lanugage:
<#assign userLang = "fr" /> <#-- or whatever you want it to be -->
<#assign resp = restadmin("/users/id/${user.id?c}/settings/name/profile.language/set?value=" + userLang?url)/>
Unfortunately, the documentation for setting the profile.language (or really, any setting) does not include the critical last part of the correct API call,
https://community.yoursite.com/restapi/vc/users/id/[user_id]/settings/name/[setting_name]/set?value=[language_id]?url
or, for example,
https://community.khoros.com/restapi/vc/users/id/1234/settings/name/profile.language/set?value=fr?url
where?url indicates that it should be url encoded.
Ok, hope that all answers your question enough for you to get a working solution. If not, mdfw just tag me here and I'll try to help some more
- Ian
mdfw
2 years agoGenius
IanKl - OK! That's one missing piece that we didn't have before. We are getting closer.
But how do we do this for anonymous users? Can't call against the user collection for a user that doesn't have an id. I assume there's something in the session that can get set? Something like:
<#assign userLang = "fr" /> <#-- or whatever you want it to be -->
${http.session.setAttribute("WHAT?", userLang)}>
Related Content
- 9 days ago
- 13 years ago
- 10 years ago