User's preferred language

An application can get the user's preferred language and territory as configured on the front-end platform.

The user preferred language can, for example, be useful in selecting appropriate content based on language preferences, and in starting other programs by setting the expected application locale.

To get the user preferred language as defined in the front-end, perform a standard.feInfo front call with the userPreferredLang option:
PRIVATE DEFINE fe_lang STRING

FUNCTION get_fe_lang()
  IF fe_lang IS NULL THEN
     CALL ui.Interface.frontCall( "standard", "feInfo", ["userPreferredLang"], [fe_lang] )
  END IF
  RETURN fe_lang
END FUNCTION
The front-end locale configuration depends on the type of front-end:
  • For Genero Browser Client (GBC), the front-end locale is defined in the web browser preferences.
  • For Genero Desktop Client (GDC), by default the front-end locale is defined by the operating system language settings. It can eventually be configured with a GDC option.
  • For Genero Mobile for Android (GMA) and Genero Mobile for iOS (GMI), the front-end locale is defined by the device language settings.
The format of the returned value is:
language_territory
For example, when running the GDC front-end on a Linux® platform with LC_ALL defined as en_US.utf8, the front call will return:
en_US