The data dictionary is an important tool for the creation of multilingual systems, using this resource it is possible to create a data repository for use in the applications generated in the project or in new applications.
The data dictionary is associated with one or more tables, when creating an application, using one of these tables, at the location of the field label a lang will be displayed, created by Scriptcase automatically, which makes it possible to change the language of the applications at run time. In pre-existing applications in the project it is possible to synchronize them.
We will see in this example below, how to use this feature.
2. Next, we will be redirected to the initial screen for creating the data dictionary, where we must inform the name and connection that we will use.
3. Next, a screen will be displayed containing the List of all tables that the previously selected connection has access to.
In this step we must select the tables in which we will create the data repository. In this example I will only use the cities table.
4. Then we will be redirected to the screen below. In this step, we must choose whether we want Scriptcase to create indexes on the field labels, so that we can create a project with multiple languages, which can be changed dynamically.
5. In this step we can view the tables synchronized with the data dictionary.
Edit- The Edit button at the top of the screen makes changes to the data dictionary properties.
Database tables- Clicking on the database tables option will display a list of unsynchronized tables and you will 'return' to step 3
Synchronize dictionary- The Synchronize dictionary option is also when selecting one or more tables. In this option you 'return' to step 4 and can update dictionary information if you have made changes to the tables. Remember to clear the cache before performing this synchronization.
Synchronize applications- The Synchronize applications option is enabled when selecting one or more tables. In this option, it is possible to create indexes on existing applications. Visualize the next step.
Edit (Scriptcase Fields)- In Edit, next to the version, it is possible to make some changes in the Scriptcase fields, these changes will be used for all applications created using the selected table. check this option in the image below:
6. The Synchronize applications option is enabled when selecting one or more tables. In this option, it is possible to create indexes in the applications already existing in the project, using the selected tables.
After selecting the tables and clicking on proceed, the screen below will be displayed:
This screen contains all the existing applications that use the selected tables, and beside the properties that will be updated. After completing the process, the following screen will be displayed:
You can check the log, using the Display log button, of the changes made or finalize the data dictionary by clicking Close.
Option Display log:
7. To edit the langs that were created, go to Locales > Application language.
8. A folder will be created in Project messages, with the name of the table. By clicking on this folder it is possible to view the langs created and the name of the fields in the project languages, previously selected.
Note: When creating a lang manually, in the dictionary select the tables, click Synchronize applications, so that the lang is automatically included in all applications in the selected table.