'translations': Customising and Translating Strings in Lycia LowCode

'translations' Setting Overview

Other Ways of Strings Customization and Translation

Localisation Using .4s Files

Customisation Towards Human-Readable Field Names

'translations' Setting Overview

Note: Before proceeding, get acquainted with the Settings Levels section of LyciaLowCode Settings page (the concept of levels is essential for configuring multiple interactions and the multitable support).

The definitions like LET <setting_variable>.<setting_name> = <value> refer to the InteractForm_Settings level, while LET <setting_variable>.views["<db_table_name>"].<setting_name> = <value> refers to the View level.

This setting can be defined for:

InteractForm_Settings level: Yes

View level: No

translations is an optional property. It’s a map of message / table / column translations.

This map is a HASHMAP of STRING. The key of the HASHMAP is the original string, and the value is the customised / localized string:

LET <settings_var>.translations["<original_string>"] = "<localized_string>"

Example:

LET settings.translations["activity"] = "Customer Activity"

LET settings.translations["activity.activity_id"] = "Activity Identifier"

LET settings.translations["Do you really want to delete this item?"] = "Möchten Sie diesen Artikel wirklich löschen?"

 

Return to top

Other Ways of Strings Customization and Translation

You can customize / localize messages, text, names of tables and columns. To use localized resources, you need to deploy them in the same folder the application is deployed to, or define a path in the FGLSOURCEPATH environment variable.

 

Return to top

Localisation Using .4s Files

Step 1. In your program’s resources, create the .4s file describing the translations map.

For example, create a file named default_de_DE.4s with the following lines:

default_de_DE {

Do you really want to delete this item? {Möchten Sie diesen Artikel wirklich löschen?}

Company ID {Firmen-ID}

}

Step 2. In your .fm2 form file, change the format of the Label text to the following: %"<string>"

Example:

<Label text="%&quot;Company ID&quot;" .../>

<string> here is the text you need to customise.

Note: Localised strings will be displayed if the environment variable is set in inet.env, or if the user's browser locale is the same as the Language-Territory Name specified in .4s file.

 

Return to top

Customisation Towards Human-Readable Field Names

There are two ways to customise the field names in Lycia LowCode to display “human-readable“ names:

<TextField identifier="activity_id" fieldTable="activity" ...../>

<Label identifier="lb_activity_id" fieldTable="activity" text="Activity identifier" ...../>

<TableColumn text="Activity identifier" .....>

<TextField identifier="activity_id" fieldTable="activity" ...../>

</TableColumn>

 

Return to top

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.