TranslationLoad
- Last UpdatedOct 29, 2026
- 3 minute read
TranslationLoad is a built-in function that loads an external translation file and then either replaces or appends to the current translation.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
TranslationLoad |
Translation |
Synchronous |
No |
Supported |
Supported |
Not supported |
Not supported (see Notes below) |
Executed on Server (see Notes below) |
Syntax
TranslationLoad(strFileName,numAppend)
TranslationLoad ( strFileName , numAppend )
strFileName
The name of the translation file (.trn) to be loaded. The file must be located in the Web sub-folder of your project folder (for example, <project name>\Web\Translation.trn).
Translation files are simply tab-separated text files, and you can use any spreadsheet or text editor to create and edit them, but in most cases you should be able to duplicate an existing file and then use the Translation Table worksheet in the project development environment to edit it. For more information, see Project Localization.
numAppend
A numeric flag that indicates whether the loaded translation file replaces or appends to the existing contents of the Translation Table. Specify one of the following values:
|
Value |
Description |
|---|---|
|
0 |
Completely replace the contents of the Translation Table with the contents of the loaded translation file. |
|
1 |
Keep the contents of the Translation Table, and then append the contents of the loaded translation file only if they are not already present. |
|
2 |
Keep the contents of the Translation Table, and then append the contents of the loaded translation file, replacing any duplicates. |
|
3 |
Reset the Translation Table to its initial contents when the project was run. If this value is specified, strFileName is ignored. |
Return value
This function returns one of the following possible values:
|
Value |
Description |
|---|---|
|
-3 |
Failed to load the translation file. The file format is invalid or you do not have the necessary privileges. |
|
-2 |
The specified file cannot be found. |
|
-1 |
Invalid parameter(s). |
|
0 |
Function executed successfully. |
Notes
The Translation Table is maintained by the project runtime server, and the contents of the table are available to all connected thin clients. Each client can call the SetLanguage function to translate the project screens that it displays, but changes to the Translation Table itself must be done on the server. As such, this function is not supported on Thin Clients; it must be called in a procedure, script, or worksheet that is executed on the server. If you want to trigger the execution of this function from a Thin Client, either configure the worksheet to have an appropriate execution control or use the RunGlobalProcedureOnServer function.
This function is supported on Mobile Access, because the Mobile Access runtime maintains its own Translation Table separate from the project runtime server and the contents of the table are available only to the Mobile Access web interface. In order to make changes to the Translation Table for Mobile Access, this function must be called in a project screen as it is being viewed in the Mobile Access web interface. Unfortunately, due to this fundamental difference between the project runtime server and the Mobile Access runtime, it is not possible to develop a project screen that behaves exactly the same for both.
Examples
Load alternate.trn and replace the current contents of the Translation Table:
TranslationLoad("alternate.trn",0)
Load pt-BR.trn and append it to the current contents of the Translation Table:
TranslationLoad("pt-BR.trn",1)
Reset the Translation Table to its initial contents when the project was run, or in other words, reload the default translation file (Translation.trn):
TranslationLoad("",3)