Forum Discussion
"/users/id/"+user.id+"/profiles/name/language/set?value=de"
The rest looks good
AWESOME!
Just to double check, this should work on production, right?
Also, it seems to work, except that the page needs to be reloaded after for the setting change to take effect, otherwise you end up with 2 different languages being displayed on the same page. I currently have a javascript refresh set up in the following code, but is there a Freemarker page reload command to avoid the delay? I couldn't locate it on freemarker.org or on google.
<#assign nodeLanguage = coreNode.settings.name.get("profile.language", "en") />
<script>console.log('nodeLanguage','${nodeLanguage}');</script>
<#assign userLanguage = rest("/users/id/${user.id}/settings/name/profile.language").value>
<script>console.log('userLanguage','${userLanguage}');</script>
<#if nodeLanguage != userLanguage>
<#assign response = restadmin("/users/id/"+user.id+"/profiles/name/language/set?value="+nodeLanguage)/>
<script>location.reload();</script>
<#-- can this reload be in freemarker? -->
</#if>
Thanks!
Alan
Related Content
- 3 months ago
- 9 days ago
- 11 months ago