Language Priorities

Introduction

FNZ Studio provides support for a complete multi-language framework based on language labels. Labels are used to translate text shown in the Portal into different languages supported by your solution. Instead of entering text into your Screens, enter the relevant text as Languages, Labels and Translations. You can then enter the translation of this text in different languages, without having to manually create multiple, language-specific Screens. Labels are translated to the user's language on the fly.

How does FNZ Studio know which language to display in the UI? FNZ Studio uses a multi-level strategy to determine users' language preferences. It considers all possible language configuration possibilities, starting with HTTP Query parameters and Session Attributes, through to Cookies and persistent user-based and system-based configurations.

As an example, the text in a Screen may read, "First name" and "Last name". If this text has been created using Labels, a user with the language preference set to English still sees, "First name" and "Last name". But if the language preference of the user is set to German, the same text is then displayed as "Vorname" and "Nachname", if a German translation has been provided for the Labels.

Language Priority Steps

To determine what language is displayed in users' web browsers, FNZ Studio processes the following 10 steps for each web request.

Configuration Type Priority Description
Query Parameter 1 The most common use of languages is the HTTP Query parameter transported in the URL as a name-value pair.
http://host/.../...?language=en
The lifetime of the Language Preference is limited to the request and is not persisted.
URL Path 2 Similar to the Query Parameter, the Language Preferences are transported via the URL.
http://host/.../.../language/en
The lifetime of the language setting is also limited to the request but can be cached.
Session Attributes 3 Language Preferences can be stored as session attributes. This is commonly used in Web Applications to remove information from the HTTP Query String.
FNZ Studio provides a set of Script Functions to support Create, Read, and Write operations on any Session Attributes.
HTTPSESSIONSET('language','en_US') // sets the name=value to the User's HTTP Session
String $language := HTTPSESSIONGET('language') // returns 'en_US'
HTTPSESSION(true); // get or create the User HTTP Session
Language Preference is deleted as soon as the HTTP Session becomes invalid.
Cookie 4 Similar to the HTTP Session method, Cookies provide simple persistence for Language Preferences.
HTTPCOOKIESET('language','en_US') // sets the name=value to the User's Cookie
String $language := HTTPCOOKIEGET('language') // returns 'en_US'
Note: a lifetime can be set when creating the Cookie.
Language Preference is deleted when the Cookie is manually removed from the Browser or when the Cookie's Lifetime expires.
User Preferences 5 The Language Preference can be stored as a User Property for registered users in FNZ Studio.
USER().setPreference('language','en_US')
String $language := USER().getPreference('language') // returns 'en_US'
User Preferences are stored as long as the User exists within FNZ Studio's User Management.
Browser Language 6 If none of the above configurations provides a valid Language Preference, the Web Browser Language Settings are considered. FNZ Studio searches for the best match on the provided language strings according to the priority provided by the Web Browser.
Default Language 7 FNZ Studio provides a configuration property which can be set to manually define the default platform language.
nm.default.locale = en
The FNZ Studio Model must contain the language set in nm.default.locale as an FNZ Studio Business Object.
Java Configuration 8 The default platform language can be set via Java Configuration Properties.
Java -Duser.language=en
System Setting 9 If none of the above language decisions return a valid Language, the System (OS) settings are used as default preferences.
Nothing Found (Fallback) 10 If FNZ Studio does not retrieve any Language Preference, or there is no language label corresponding to any Language Label, or there is a missing translation within the Language Label, FNZ Studio will display the Label ID and the preferred language.
[LABEL:label.id]