Tuto WEBDEV 25
246 Part 5: Let’s continue the development 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 a site, the language can be chosen via a menu option. You can change the language of the application being run using Nation in the code associated with the menu option. Adding a menu option ▶ To add a menu option: 1. If necessary, open "Product_List_PAGE" in the editor (double-click on its name in the "Project explorer" pane). 2. Click the menu and select "Open the template" from the popup menu. 3. In the page template, select and click "Pages". 4. The menu becomes editable and a yellow border is displayed. 5. Press the Space key on the keyboard: the caption becomes editable. 6. Type the caption ("Languages") and validate. 7. Select the "LANGUAGES"’ option you have just created. 8. Display the popup menu (right click) and select "Insert a sub-menu". 9. Select the menu option that was just created. 10. Press Space to edit the caption. 11. Enter the caption of the first sub-option: "English". Press Enter to validate the input. 12. Select the first sub-option again. 13. Press Enter: a second sub-option is created. 14. Press the Space key and type the caption of second sub-option: "French". ▶ As we are positioned in the page template, let’s translate the last menu option: 1. Select "CONTACT". 2. Display the description window of option. 3. Type "Contact us" for the English language. We are now going to type the WLanguage code required to change language.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==