Tuto WINDEV 25
322 Part 4: Full application with data Programming the change of language By default, the project is run in the runtime language defined for the project, in the "Languages" tab of project description ("Description" in the "Project" pane). In an application, the language can be chosen via a menu option. You can change the language of the application being run using Nation in the event associated with the menu option. Adding a menu option ▶ To add a menu option: 1. Open the "WIN_Menu" window in the editor if necessary (double-click its name in the "Project explorer" pane). 2. Click the "Menu" option of window. The menu is expanded. 3. Select "Send an email". 4. Display the popup menu (right click). Select "Add after". Type the caption ("Languages") and validate. 5. Select the "Languages"’ option you have just created. 6. Display the popup menu (right mouse click) and select "Transform to expand a sub-menu". 7. Type the caption of first sub-option: "English". 8. Press the Enter key twice and type the caption of second option ("French"). We are now going to type the WLanguage code required to change language. Programming To type the code for managing languages: 1. Select "Menu .. Languages .. French" in the editor. 2. Display the popup menu (right click). Select "Code". 3. Write the following code: Nation(nationFrench) 4. Select "Menu .. Languages .. English" in the editor. 5. Display the popup menu (right click). Select "Code". 6. Write the following code: Nation(nationEnglish) Nation is used to change the runtime language of application. The constants passed in parameter allow you to specify the language to use. The change of language performed by Nation is immediately effective.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==