cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Switch language preference on demand

AhsanKhan
4-Participant

Switch language preference on demand

Hey guys I have an application which logs in all Users as TVUsers and uses its own authentication system. I was hoping for there to be a way to switch languages on demand without setting the language preference for TVUser.

 

If that's confusing feel free to ask below. Thanks!

4 REPLIES 4

Hi @AhsanKhan ,

Are you trying to change the language at Mashup Runtime?

 

Regards

Bhawna

AhsanKhan
4-Participant
(To:bchaudhary)

Yup! Is that possible? I basically want to switch the language without having to associate the language with any TW User. Is that possible?

Hi @AhsanKhan 

 

Kindly follow the steps:

  • Steps to set-up dropdown language selection:
    1. On any thing, create a service with the following line of Javascript code and two input parameters:
      • // input parameters are Username and Language, both strings
        Users[Username].SetLanguagePreferences({preferences: Language});
    2. On your mashup, add a list widget and configure it to appear as a dropdown box
    3. Import the service GetLanguages located under the entity RuntimeLocalizationFunctions in the Data tab and check the box labeled "Mashup Loaded?"
    4. Drag All Data from this to the dropdown list widget and bind it as Data
    5. Under DisplayField property, select "languageNative"
    6. Import the service created in step one in the Data tab
    7. Switch to the User tab
    8. Click and drag the name field to the Data tab so it switches back, then continue dragging down to the Username input parameter of the service created in step one
    9. Expand the Selected Row(s) section of the GetLanguages service
    10. Drag the name field to the Language input parameter of the service created in step one
    11. Drag and drop a button onto the mashup
    12. Drag the Clicked event of the button to the service created in step one
    13. Grant runtime service execute permissions to the Users group on the thing with the service created in step one
    14. Grant mashup visibility to any organizational unit which contains the Users accessing this mashup.

Let me know if this works for you.

 

Regards

Bhawna

AhsanKhan
4-Participant
(To:bchaudhary)

Hey Bhawna,

 

Thanks for your reply but this isnt exactly what I am looking for. I have this system already setup but my problem is that when multiple users are using the application all logged in as the same User they may want to have different language settings. My goal is to somehow allow them to have their own language set even though they are all logged in as the same TW user. The goal is to somehow change languages without linking them to a User? Is this possible.

Announcements


Top Tags