--- title: "Current locale" slug: "core-current-locale-resolver" updated: 2026-04-16T07:45:42Z published: 2026-04-16T07:45:42Z canonical: "docs.lobstersoftware.com/core-current-locale-resolver" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Current locale > [!NOTE] > Value resolver – Abstract > > **Purpose:** This returns the dynamic enumeration value of the [Locale](/v1/docs/en/core-locale) valid in the current session. For *country-specific* languages, the reference to the country can be selected or unselected. > > > [!TIP] > > Tooltip > > > > - **Usage**: The value resolver returns the dynamic enumeration value of the [Locale](/v1/docs/en/core-locale) selected for the current session "with or without country". The input value is ignored. > > - **Parameter**: The **Locale without country** option determines whether the locale with country (e.g. "German (Switzerland)") or without country – i.e. only the base locale (e.g. "German") – should be returned for country-specific languages. > > - **NOTE:** The [Current locale](/v1/docs/en/core-current-locale-resolver) does not change when a [Run as](/v1/docs/en/base-run-as-actor) event action temporarily changes the user or company of the session. ![images/download/attachments/91135153/image2022-2-10_16-57-28-version-1-modificationdate-1644508648249-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-2-10_16-57-28-version-1-modificationdate-1644508648249-api-v2.png) The [Current locale](/v1/docs/en/core-current-locale-resolver) value resolver identifies the [Locale](/v1/docs/en/core-locale) applicable to the current session. The *return value* is a value from the relevant dynamic enumeration ([Locale](/v1/docs/en/core-locale)). The **Locale without country** option defines whether the value resolver for *country-specific* distinct languages returns their enumeration value or the enumeration value of the *global* locale to which the applicable language refers. **NOTE:** - The [Current locale](/v1/docs/en/core-current-locale-resolver) cannot be temporarily changed by the [Run as](/v1/docs/en/base-run-as-actor) event action, unlike other session features (e.g. [User of session](/v1/docs/en/base-session-user-value), [Role of session](/v1/docs/en/base-session-role-value) and [Company of session](/v1/docs/en/base-session-company-account-value)). - If a different temporary user is declared as [User of session](/v1/docs/en/base-session-user-value) by a [Run as](/v1/docs/en/base-run-as-actor) event action, the user's "language" selection does not apply as the [Current locale](/v1/docs/en/core-current-locale-resolver) executed in the changed context. - If a user changes the language via [Change locale](/v1/docs/en/gui-user-menu-locale), this change only takes effect when the user logs in again as [Current locale](/v1/docs/en/core-current-locale-resolver), although the change is immediately saved in the user account. ## Configuration The **Locale without country** option relates to the possibility of defining *country-specific* versions of a given global locale when defining languages in the dynamic enumeration [Locale](/v1/docs/en/core-locale). | ![images/download/attachments/91135153/image2022-2-10_16-57-45-version-1-modificationdate-1644508665159-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-2-10_16-57-45-version-1-modificationdate-1644508665159-api-v2.png) | If the option is not checked (default), then the value resolver returns the dynamic enumeration value for the (*country-specific*, if applicable) locale in effect in the session, e.g. the language "German (Switzerland)" (de_CH) or "English (US)" (`en_US`). **NOTE:** The return value with this setting corresponds to the value in the `locale` property of a *Print XML*. | | --- | --- | | ![images/download/attachments/91135153/image2022-2-10_16-58-11-version-1-modificationdate-1644508691902-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-2-10_16-58-11-version-1-modificationdate-1644508691902-api-v2.png) | If the option is checked, then the value resolver returns the dynamic enumeration value for the *global* locale that either applies directly to the session or is referred to by the logged-in *country-specific* language: - If the session uses the *country-specific* locale "German (Switzerland)" (`de_CH`) the return value "German" (`de`) would apply, for "English (US)" (`en_US`) the value "English" (`en`), etc. - If the session already uses a *global* locale, e.g. "English" (`en`), this will be returned directly. Special case: - If the session uses a *country-specific* locale whose internal name (name of the enumeration value) refers to a global locale that is not defined as a global locale, then by default (see [Locale](/v1/docs/en/core-locale), "Precedence rules") the language "English" (`en`) is used for the session and not, for example, the default locale defined in the system. In this special case, the enumeration value for "English" (`en`) also appears as the return value of the [Current locale](/v1/docs/en/core-current-locale-resolver) value resolver. | ## Example An association criteria (see [Association criteria](/v1/docs/en/core-association-criteria)) is considered "passed" if a *country-specific* locale is used in the current session. Depending on this association criteria, an [Image/Icon](/v1/docs/en/fre-image-vo) element can be displayed or hidden in a form that shows a graphic for the flag of the country "coded" in the locale (if available). Runtime example: ![images/download/attachments/91135153/image2022-2-10_17-3-26-version-1-modificationdate-1644509006729-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-2-10_17-3-26-version-1-modificationdate-1644509006729-api-v2.png) - The image shows a section of an input form for shipment details, where the [Current locale](/v1/docs/en/core-current-locale-resolver) is visualized by flag icons in the header area in addition to a reference in the [User of session](/v1/docs/en/base-session-user-value). - In the session shown, the [Locale](/v1/docs/en/core-locale) "English (US)" (`en_US`) is selected. The right flag symbol (here: USA) should only be visible if a *country-specific* locale is selected. **NOTE:** The left flag of the two "flags" is defined by another section in the [Client Workflow](/v1/docs/en/frebehav-client-workflow) described only partially below, based on [Current locale](/v1/docs/en/core-current-locale-resolver) ("without country"). However, it must be taken into account that the internal name of the [Locale](/v1/docs/en/core-locale) "English" (`en`) does not correspond to an ISO 3611 alpha2 abbreviation. The output in the runtime example can be obtained by placing a copy of the flag graphic `gb.png` under the name `en.png`. Then this assignment (`en=gb`) can also be used in other contexts. Otherwise, this can be done by replacing the "language name" `en` with the country code `gb` (or any other such as `us` or `au`) using [Replace text](/v1/docs/en/core-replace-string-resolver) when building the file name. Configuration: To detect the selection of a *country-specific* locale in the context of the current session, a custom association criteria is created and configured as follows: | An [Entity property rule](/v1/docs/en/core-entity-property-rule) is used to compare the return values of the [Current locale](/v1/docs/en/core-current-locale-resolver) value resolver with and without selecting the **Locale without country** option: - On the left side of the comparison, the **Locale without country** option is not checked in the [Current locale](/v1/docs/en/core-current-locale-resolver) value resolver. At runtime, the selected [Locale](/v1/docs/en/core-locale) is queried, whose enumeration value specifies a "Locale with country" as appropriate. - On the right side of the comparison, the **Locale without country** option is checked in the [Current locale](/v1/docs/en/core-current-locale-resolver) value resolver. Therefore, the **Locale without country** is queried, and either the enumeration value for the global locale returned as the selected language – and if it does not exist – the default value given by the system: "English" (`en`). - The selected comparison type [Equals](/v1/docs/en/core-equals-matcher) is negated (see [not (Matcher)](/v1/docs/en/core-not-matcher)), so that the association criteria is considered "passed" if the left and right resolved values are different. | ![images/download/attachments/91135153/image2022-2-10_17-5-27-version-1-modificationdate-1644509127393-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-2-10_17-5-27-version-1-modificationdate-1644509127393-api-v2.png) | | --- | --- | A behavior is added to the form that links the visibility for the [Image/Icon](/v1/docs/en/fre-image-vo) element representing the "country" referenced in the locale to the association criteria shown above: | - The behavior shown on the right responds to the **Triggering event** [Form data loaded](/v1/docs/en/fretrigger-form-data-loaded-element), which ensures that the visibility of the [Image/Icon](/v1/docs/en/fre-image-vo) element when displaying data in the form is controlled "appropriately" for the session. - The **Behavior type** [Association criterion matched](/v1/docs/en/frebehav-association-criteria-matched) checks whether the association criteria shown above is true or not. - In the **Actions on "true"**, a [Show element](/v1/docs/en/freaction-show) action makes the **Target** **element "**Country code" (the [Image/Icon](/v1/docs/en/fre-image-vo) with the second flag) visible if the association criteria is true, i.e. if a *country-specific* language is selected. - In the **Actions on "false"**, a [Hide element](/v1/docs/en/freaction-hide) action makes the **Target element** "Country code" (the [Image/Icon](/v1/docs/en/fre-image-vo) with the second flag) invisible if the association criteria does not apply, i.e. no *country-specific* language is selected. | ![images/download/attachments/91135153/image2022-2-10_17-6-50-version-1-modificationdate-1644509210752-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-2-10_17-6-50-version-1-modificationdate-1644509210752-api-v2.png) | | --- | --- | Depending on the selected locale, the appropriate flags appear in the form header. In response to the [Form data loaded](/v1/docs/en/fretrigger-form-data-loaded-element) trigger, another behavior is called that uses a [Client Workflow](/v1/docs/en/frebehav-client-workflow) to define a "client object" that contains all the required "header data" as field values. The following section shows how to use the [Current locale](/v1/docs/en/core-current-locale-resolver) value resolver to extract the country identifier for the "country" from the "locale with country". **NOTE:** In this case, it is assumed that when defining a *country-specific* language, it complies with the convention (see [Locale](/v1/docs/en/core-locale)) that the internal "name" of the dynamic enumeration value links the flag for the *global* locale to the two-character ISO-3166-alpha2 country flag for the referenced country via an underscore ("_"). In the system-provided path `./assets/ammap/flags/`, there is a `png` graphic file for most country flags that represents the corresponding "flag". | The [Set value](/v1/docs/en/core-set-value-actor) event action shown on the right assigns the relative file path for the [Image/Icon](/v1/docs/en/fre-image-vo) element to the `country` field of the "client object", which is displayed optionally for *country-specific* languages. The file path is built using a [Concat strings](/v1/docs/en/core-concat-string-resolver) value resolver: - The first component of the [Concat strings](/v1/docs/en/core-concat-string-resolver) defines the static text for the base path for the "flag" graphic files:`./assets/ammap/flags/` - The second component of the [Concat strings](/v1/docs/en/core-concat-string-resolver) obtains the [Current locale](/v1/docs/en/core-current-locale-resolver) (possibly "with country"). The "Name" (`name`) property is extracted from the dynamic enumeration value returned by the concatenated [Object property](/v1/docs/en/core-property-resolver) value resolver and passed on to the subsequent [Replace text](/v1/docs/en/core-replace-string-resolver) resolver. - In the [Replace text](/v1/docs/en/core-replace-string-resolver) value resolver, the [Current locale](/v1/docs/en/core-current-locale-resolver) is queried again as **Search text,** but this time with the option **Locale without country**. The "Name" (`name`) property is extracted from the return value again. The underscore ("_") is added here per [Concat strings](/v1/docs/en/core-concat-string-resolver). This combination is deleted from the name of the "Locale with country". Therefore, no value is entered under **Replace with**. - Since the filenames for "flags" use the lowercase country identifier as the filename, the concatenation is followed by a [Lower case](/v1/docs/en/core-to-lower-case-resolver) value resolver before the uniform file extension (`.png`) is appended as the third component of the [Concat strings](/v1/docs/en/core-concat-string-resolver). | ![images/download/attachments/91135153/image2022-2-10_17-9-57-version-1-modificationdate-1644509397734-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-2-10_17-9-57-version-1-modificationdate-1644509397734-api-v2.png) | | --- | --- | Runtime example: ![images/download/attachments/91135153/image2022-2-10_10-23-3-version-1-modificationdate-1644484983283-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-2-10_10-23-3-version-1-modificationdate-1644484983283-api-v2.png) - The image shows the section of a data input form for shipment details already shown at the beginning of this chapter. - However, the [Locale](/v1/docs/en/core-locale) "German (Switzerland)" (`de_CH`) is selected in the session shown. Further runtime example: ![images/download/attachments/91135153/image2022-2-10_15-25-4-version-1-modificationdate-1644503104599-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-2-10_15-25-4-version-1-modificationdate-1644503104599-api-v2.png) - This image shows the appearance of the same shipment details input form after the following steps have been performed: - An additional supported language "Klingon" has been created in the dynamic enumeration for [Locale](/v1/docs/en/core-locale), which is assigned the internal "name" (`name`) `xt_KG`. - A small image of the Klingon flag was uploaded with the [File manager](/v1/docs/en/ac-environment-filemanager) (relative file path: `./assets/ammap/flags/xt_kg.png`). - For the user, "Klingon" was selected via [Change locale](/v1/docs/en/gui-user-menu-locale) and the session was logged off and on again. - What happens at runtime? - The name `xt_KG` for the language "Klingon" formally refers to a *global* locale with the randomly chosen name `xt`, which is not defined in the system. - Therefore, the language predefined by the system "English" (`en`) is effective and also specified by the [Current locale](/v1/docs/en/core-current-locale-resolver) value resolver per **Locale without country** option (see the "Locale" flag on the left in the image). - The [Replace text](/v1/docs/en/core-replace-string-resolver) value resolver in the [Client Workflow](/v1/docs/en/frebehav-client-workflow) therefore attempts to eliminate the prefix `en_` which is not found in `xt_KG`. - Therefore, the name `xt_KG` is assigned to the formal *country-specific* language "Klingon" without any substitution, but in lowercase letters as the file name for the "locale" flag (right in the image), whose file name should therefore be `xt_kg.png`.