Adding a New Translatable String

Use the Schema class addCompileTranslatableString method to add a translatable string to all base locales of the receiving schema. If the schema is versioned, the receiver must be the current version.

In the first parameter (source), specify the source for the translatable string. This must be in the standard JADE format, as follows.

string-name optional-parameter-list = translatable-string-expression

The optional parameter list contains one or more parameter name identifiers, separated by commas and enclosed in parentheses.

The translatable string expression consists of string literals, global constant names, and translatable string identifiers concatenated with the ampersand (&) operator. You can use white space characters (that is, space, tab, and CrLf) between tokens, as these are ignored. You can also include line comments (//) and stream comments (/* */).

If the source includes a translatable string identifier, the embedded string must also exist.

The process must be in transaction state before the addCompileTranslatableString method is called. If the method locates an error (for example, the name of the translatable string is already in use), the method aborts the transaction before returning. You can call the method multiple times in the same transaction.

The caller is responsible for committing successful updates.

This method returns false if the addition was successful and it returns true if an error was located and the transaction was aborted. The error details are returned in the second, third, and fourth parameters of the method (that is, errorCode, errorOffset, and errorLength, respectively). The token (if any) in the source string where the error was detected is found at the value of the errorOffset parameter for the value of the errorLength parameter.

You can use the Process class getErrorText method to obtain the description of the value of the errorCode parameter.