Updating an Existing Translatable String

Use the TranslatableString class updateCompile method to update an existing translatable string. If the translatable string is versioned, the receiver must be the current version.

Updates to the current version of a versioned translatable string are not carried forward to its latest version.

In the first parameter (source), specify the new source for the translatable string. This must be in the standard JADE format. For details about this format, see "Adding a New Translatable String", in the previous section.

The process must be in transaction state before this updateCompile method is called. If the method locates an error (for example, the name does not match), 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 update 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.

You cannot change the name of an existing translatable string.

If you want to change the number of parameters in a translatable string, you must first change the translatable string in the schema default locale, or the update will fail with exception 6331 (Parameter count does not match default locale translation).