Make Messages Translatable¶
Constants, error messages and information messages should all be translatable into different languages. The base server code is scanned and later translated in Translation Manager. A specific syntax is used, so the scanning tool can find and extract the texts which should be used for translating.
Each message text that should be translated is identified with a keyword, which can contain capital letters along with numbers or underscores or both and it may not be longer than 20 characters, e.g. NOTALL_CHKD2. Each keyword must be unique within a logical unit. The keyword is separated with a colon (:) from the actual text to translate. For optional variables that should be displayed in the message, write:P1, :P2, :P3 in the message and include the values and descriptions that should be in the message as parameters in the call.
Constants are often texts stored as a value in the database before they are displayed in the client. For more details about error handling, see the Error Handling section, and for more details about information messages, please see Client Information.
Example: Constant¶
info_ := Language_SYS.Translate_Constant(lu_name_,'NOTALLCHKD: Vouchers cannot be created in company :P1. Load with identity :P2 contains transactions that are not checked', NULL, company_, load_id_);
Example: Error Message¶
Error_SYS.Appl_General(lu_name_, 'STATE_TRANSITION: Invalid state transition from [:P1] to [:P2] on application message [:P3]', old_, new_, newrec_.application_message_id);
Example: Information Message¶
Client_SYS.Add_Warning(lu_name_, 'INVALID_STATUS2: Project activity :P1 not valid. Do you want to continue?', newrec_.activity_name);