How to modify or translate messages in compiled workbook
The custom resources dictionary allows you to modify or create custom runtime messages in the compiled workbook. You can also translate some of the default messages in the compiled workbook to another language.
The custom resources dictionary is a text file encoded in UTF-8. The compiled EXE file incorporates some of the text resources from the dictionary file to show messages.
As a matter of fact, you can create your own resources dictionaries for different languages.
To create a custom resources dictionary, you need to copy the ‘ENGLISH.dic’ file from the DoneEx XCell Compiler installation folder to any location where you are going to keep it and then rename the file.
Open this newly copied dictionary file in Microsoft NOTEPAD.
Content of the dictionary file has a ini-file structure. Notice that each text resource is written as a key/value pair connected by the ‘=’ assignment sign on a single line: MNEMO_CODE_KEY=Text value
.
In the image above, MNEMO_CODE_KEY is highlighted with red and the text value is highlighted with green.
You have to keep the MNEMO_CODE_KEY (left side, before the assignment ‘=’ sign) unchanged.
If you want to change a text value of a resource, then you need to rewrite the part to the right of the ‘=’ assignment sign with your content. Particularly, we recommend writing the text value in a single line. In other words, without starting a new line. Some of the text resources may appear in a multiple lines message box. To start a new line in the text you need to insert the ‘\n’ symbol combination. While displaying, ‘\n’ will change to a new line transfer.
Example of resource record structure for custom runtime messages:
MNEMO_CODE_KEY=Text value\nThis part of text will be shown on new line.
If you want to keep some text resource empty then you need to use “\r” text (without quotas) as the value of such resource.
Like: MNEMO_CODE_KEY=\r
You can rewrite the text values for mnemo codes existing in default ENGLISH.dic file. If you add some other mnemo code and a text value for it then the message will ignore such text resources.
Make sure that your Custom resources dictionary files are in the UTF-8 encoding format. Ensure this by using the ‘Save As’ button in Notepad making sure that you have selected UTF-8 encoding.
To use the custom resources dictionary (for something like creating custom runtime messages) you need to click on the ‘Custom resources dictionary’ link on the compilation form and select the dictionary you want to use.
Related Articles: