Skip to main content
1-Visitor
Oct 1, 2017 9:27 AM UTC
Question

GetCurrentUserLanguage() is returning empty string

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.

8 replies

20-Turquoise
Oct 1, 2017 3:01 PM UTC

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.

Translate
pjoly1-VisitorAuthor
1-Visitor
Oct 3, 2017 6:22 PM UTC

Hello

any news ?

Thanks

Translate
20-Turquoise
Oct 4, 2017 2:23 PM UTC

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

Translate
16-Pearl
Sep 10, 2018 6:43 AM UTC

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

 

Translate