Skip to main content
1-Visitor
October 1, 2017
Question

GetCurrentUserLanguage() is returning empty string

  • October 1, 2017
  • 2 replies
  • 3931 views

Hello

 

I want to localize the return of a function depending of the current language of the session of the connected user.

 

Everything is ok with the labels inot mashups using the "localization tables" but when i want to know the current language in a javascript I cannot get it

 

I'm using this

 

var Language = Resources["CurrentSessionInfo"].GetCurrentUserLanguage();

 

but it is returning an empty string (the user has "fr" in the languages item

 

any ideas

(ThingWorx 7.3.2-b42)

 

 

Thanks

This topic has been closed for replies.

2 replies

20-Turquoise
October 1, 2017

I will try to reproduce this during the U.S office hours tomorrow and will let you know whether it's a bug or a configuration issue.

pjoly1-VisitorAuthor
1-Visitor
October 3, 2017

Hello

any news ?

Thanks

20-Turquoise
October 4, 2017

Have you assigned result = Language; to display the result? also assign type String to the output.

16-Pearl
September 10, 2018

Please get current user language setting as below.

    var result1 = Users[Username].GetUserPreferenceInfo();
    result=result1.getRow(2).value;

 

Below snippets DOES NOT return current setting, but return last setting when saving user settings directly from Composer. Report to R&D by Jira PSPT-5621

  • Resources["CurrentSessionInfo"].GetCurrentUserLanguage();
  • Users[username].language