Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Active users language shortname

Hi, 

Do anyone know where can i find language shortnames for the active user? 

E.g. if i do this: 

String languageId = getActiveUser().getValue("language");

it returns "0", "1" etc.. and i expected this to point to the table cust_lang: 

String GetLanguageCode(String langId)
{
  SearchEngine se;
  se.addField("cust_lang.lang_code");
  se.addField("cust_lang.id");
  se.addCriteria("cust_lang.id", "Equals", langId);
  if(se.select () > 0) 
    return se.getField("cust_lang.lang_code");
  else 
    return "Unknown";
}

Are these values hardcoded? 

//Eivind


RE: Active users language shortname

Hello,

Yes they are hardcoded, values:

  • Norwegian = 0
  • English = 1
  • German = 2
  • Swedish = 3
  • Danish = 4
  • Dutch = 5
  • French = 6
  • Spanish = 7
  • Italian = 8
  • Czech = 9
  • Finnish = 10
  • Polish = 11
Von: David Hollegien 28. Sep 2020

RE: Active users language shortname

Hi,

There is a difference between languages supported by application and languages defined in cust_lang.
Currently we have these application languages;

Norwegian = 0,
English = 1,
German = 2,
Swedish = 3,
Danish = 4,
Dutch = 5,
French = 6,
Spanish = 7,
Italian = 8,
Czech = 9,
Finnish = 10,
Polish = 11,
Russian = 12,
Ukrainian = 13
Von: Michel Krohn-Dale 28. Sep 2020

RE: Active users language shortname

Great, thank you both! :)

//Eivind

Von: Eivind Johan Fasting 28. Sep 2020

RE: Active users language shortname

Hi Eivind,

you can see these values in the intellisense of String.parseSOMultiLanguageString as well.

 

Best,

Dennis

Von: Dennis Pabst 28. Sep 2020