TranslateConstantWithParams

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalString TranslateConstantWithParams( SalString sConstant,
                                    SalArray<SalString> sParam )

The TranslateConstantWithParams method returns the translation of a translatable constant and inserts parameters in the translation.

Parameters

Name Description
SalString sConstant The translatable constant to translate. The text may optionally contain placeholders &0, &1 etc. The placeholders  are replaced with the parameters in sParam.
SalArray<SalString> sParam Array containing the value parameters that should replace the placeholders.

Returns

The return value is the translation with the parameters inserted, or the original text with parameters inserted if no translation was found.

Comments

A translatable constant is a constant whose value begins with the constant name, a colon, and a space. For example public const string TEXT_Hello = "TEXT_Hello: Hello world!" ;

This method works by replacing placeholders in the message text sMessage with the values of the replacement parameters sParam. A placeholders is an ampersand (&) character followed by a number. The number indicated what parameter value should replace the placeholder. For example &0 is replaced by sParam[0], &1 by sParam[1] etc.