https://youtu.be/i8S_zxwiQ4w
Bom Dia/Boa Tarde/Boa Noite
Esse Ao Vivo vai estrear as 16:00 do dia 02/09/2020
DICAS 3049 - WINDEV TUTORIAL 72 - GERENCIAMENTO VARIOS IDIOMAS
Tutoriel WINDEV : Leçon 4.16. Gérer le multilingue
ASSUNTOS
EXPLICANDO O QUE SERA FEITO
O QUE É APLICATIVO MULTILINGUE
CONFIGURANDO LINGUAGENS NO PROJETO - DESCRICAO
SICRONIZANDO O PROJETO
VERIFICANDO 3 MENSAGEMS DEPOIS DE ALTERADO IDIOMA
COMO COLOCAR IDIOMA NA ANALISE
DENTRO DA ANALISE BOTAO DIREITO DESCRIPTION
CONFIGURANDO ANALISE IDIOMA
ENDERECO DO CLIENTE COLOCAR IDIOMAS
GERANDO ANALISE
ALTERANDO TEMPLATE PARA COLOCAR IDIOMA
ALTERANDO A IMAGEM PARA TER MAIS DE UM IDIOMA
MOSTRAR COMO ATUALIZA O TEMPLATE
ALTERANDO AS GUIAS DAS TAB PARA IDIOMA
ALTERANDO O CODIGO PARA TRADUZIR SAIDA
ALTERANDO O MENU ENVIA EMAIL
CRIANDO TROCAR PORTUGUES PARA INGLES
Video original da Franca
https://youtu.be/VuJPN0U_w4g
Playlist Windev TUTORIAL
Lesson 4.16. Managing multiple languages
- What is a multilingual application?
- Creating a multilingual application, step by step.
Estimated time: 20 mn |
Previous Lesson | Table of contents | Next Lesson |
A multilingual application is an application that can be run in different languages (English, French, German or any other language).
Therefore, the same application can be used in several languages. But how is it possible? That's what we will see in this lesson.
We are going to handle a project that can be run in English or in French, according to the user's choice.
The main steps of a multilingual application are:
- Choosing the project languages.
- Localizing the analysis.
- Localizing the project elements (windows, reports, controls, help system, ...).
- Localizing the messages found in the code.
- Programming the change of language in the application.
Answer | If you did not perform the operations in the previous lessons, you can follow this lesson by opening a corrected project: in WINDEV's home page (Ctrl + <), click "Tutorial" and select "Full application (Answer)". |
- The first operation consists in choosing the project languages.
- Open the project description: on the "Project" pane, in the "Project" group, click "Description".
- Click the "Languages" tab. Our application will support English and French.
- Click the "Add" button. The window for selecting languages is displayed.
- Click "French". A checkmark is displayed on the right of language.
- Validate. The "French" language appears in the list of project languages.
- The "Languages" tab can also be used to configure the linguistic options regarding the numbers, the currencies, the dates, ... for the selected language. Let's see an example:
- Click the "French" language.
- Select the "Date" tab.
- The linguistic options of Windows are used by default. Select "Use the following parameters": you now have the ability to define the date format as well as the translation used for the days and months.
- Keep the option "Use the parameters defined in the linguistic options of the operating system".
Remark | In the linguistic options, you have the ability to choose the text direction for the language ("Various" tab, "Text direction" option). This allows you to create interfaces with a language written from right to left. |
- Validate. A message proposes to synchronize the different project elements. Answer "Yes". All project elements opened in the editor (windows, reports, ...) are closed and the additional languages are added to these elements.
Remark: The captions that exist in the base project language are automatically copied into the added languages.
By default, an analysis is created in a specific language and it cannot be translated.
However, some information can be typed in several languages (notes in the documentation, shared information, ...).
If your application uses Reports and Queries, the names of the data files and items can also be translated. This translation can be done in the "Reports and Queries" tab (this tab is both in the data file and the item description window).
By default, the controls created from the analysis items have the item caption specified in the analysis. If a caption was specified in the shared information of item, this caption will be used when creating the control.
When changing the language of project linked to the analysis, this change is not automatically applied to the analysis. Indeed, an analysis can be shared between several projects.
- To support several languages in an analysis:
- Display the data model editor: click among the quick access buttons of WINDEV menu.
- In the analysis description ("Analysis description" from the popup menu), select the "International" tab.
- The list of languages supported by the analysis is displayed. The French language not being supported:
- Click the "Add" button.
- Select "French".
- Validate the window for adding languages.
- Validate the description window of analysis.
Remark
To take into account all languages of the project linked to the current analysis, you also have the ability to click the "Synchronize with the project" button.
- To type shared information in several languages, let's take a simple case: entering the caption of the control linked to the "Address" item of "Customer" data file:
- Select the Customer data file.
- Open the description of items of a data file ("Description of items" in the data file popup menu).
- Select the "Address" item and display the parameters of control linked to the selected item (shared information). To do so, click the link at the bottom of the screen. The shared information is displayed in a new window.
- In the "Caption" area, type the caption for the French language: "Adresse".
- Validate the window for typing shared information.
- Validate the description window of items.
Remark
The shared information of analysis can be translated: - when creating the analysis.
- at any time via the editor.
- at any time via WDMSG and WDTRAD, tools used to extract, translate and reintegrate the different elements.
- To take into account the modifications performed in the analysis, you must generate the analysis: on the "Analysis" pane, in the "Analysis" group, click "Generation".
All project elements can become multilingual elements: windows, reports, help, ...
We are going to modify some elements of WIN_Menu window to present the different methods that can be used.
We are going to modify:
- the image of the bar used in the WIN_Menu window.
- the captions of controls found in the WIN_Menu window.
- the menu options.
- the message displayed by the WLanguage code when closing the application.
- Open the "WIN_Menu" window in the editor (double-click its name in the "Project explorer" pane for example).
- First of all, check whether the WIN_Menu window is associated with the different languages defined in the project:
- Open the window description ("Description" from the popup menu).
- Select the "Language" tab: the two languages selected in the project are displayed.
- Validate the window.
Localizing an image
- To change the image of the bar used in the WIN_Menu window according to the runtime language:
- Open the "WIN_Menu.WDW" window.
- The bar image is found in the template associated with the window. Therefore, the associated window template must be opened:
- Click the "WD FullApplication" control and display the popup menu.
- Select "Open the template".
- The window template appears, enclosed in an orange border.
- Open the bar description window:
- Select the "WD FullApplication" control and display the popup menu.
- Select "Description".
- In the "Image" area, click the button.
- Select "Multilingual" from the popup menu that is displayed.
- The window for managing multilingual images is displayed. A different image can be used for each language. This feature is very useful if you use images that contain text.
- For our example, in the "French" area, select the "header-fr.png" file:
- Click the icon.
- Select "Browse".
- Select the desired file.
- Validate. The "Multilingual value" caption appears in the "Image" area of description window.
- Validate the control description window.
- Save the window template ( or Ctrl + S).
- Update the windows that use the window template by clicking the icon in the orange bar. Validate the update window.
- Close the window template displayed in the editor.
Localizing controls
A control can display various information to the user:
- a caption,
- a help message,
- an image, ...
- For our example, we are going to translate the first pane of Tab control.
- Double-click the Tab control to display its description window.
- In the "General" tab of the description window, select "List of products".
- In the "Description of static pane" section, you can:
- type the translation for the pane caption: "Liste des produits".
- define a specific image for the tab pane according to the language (as already done before).
- define a tooltip for each language.
- Close the control description window.
Localizing a programming message
All messages found in your program can be translated into several languages. In our example, selecting the "Exit" menu displays the message "Exit from the application". We are going to translate this message.
- To translate the message of menu option:
- Display the code of menu option:
- Expand the menu in the editor.
- Select the "Exit" option.
- Select "Code" from the popup menu (right mouse click).
- To translate this type of message, position the cursor in the "Exit from application?" string and press Ctrl + T. You can also go to the "Code" pane, "Languages" group, expand "Translate strings" and select "Translate messages".
- The following window is displayed:
- This window allows you to translate all messages of your program into all project languages.
- In the "French" area, type "Quitter l'application?" and validate.
- The icon as well as a digit appear in the code editor.These icons indicate that the multilingual message exists in 2 languages.
- Close the code editor.
- Display the code of menu option:
Localizing menus
The menu options can be translated like the other controls via the description window of the option, or from the window editor directly.
- To translate the menu of "WIN_Menu" window:
- On the "Display" pane, in the "Options" group, expand "Language displayed" and select the language to display in the editor (French in our case).
- The menu options are displayed in the selected language. If no translation corresponds to the selected language, the menu options are displayed in English.
- Expand the "Menu" option.
- Select "Send an email".
- Press the Space key on the keyboard: the caption becomes editable.
- Type the caption in French: "Envoyer un email" and validate.
- Switch the displayed language back to English: on the "Display" pane, in the "Options" group, expand "Language displayed" and select "English".
Some application elements have been translated manually.
Several methods can be used to translate this information:
- a direct translation of messages performed in the different editors. This translation can be performed via a translation tool, Google Translate (providing that you own a license), ...
- a translation performed via an external tool (WDMSG and WDTRAD).
Direct input of translations
The translations are typed in the product interface directly. For example, the caption of "New" button becomes "Nouveau" in French. Simply open the control description window and enter the corresponding translation in the desired language.
If you want to use a translation software or a translation site, WINDEV can be configured to use this software:
- On the "Home" pane, in the "Environment" group, expand "Options" and select "General options of WINDEV".
- Display the "Translation" tab.
- Specify:
- Whether the regional settings must be automatically enabled according to the language used for the input. In this case, if the language requires a specific character set, this character set will be automatically selected.
- The software or the site that will be used for translation. You have the ability to use WDDixio, translation dictionary supplied with WDMSG (see next paragraph), a specific translation software or site, or Google Translate.
See Translation by Google Translation for more details. - The supported languages.
- When the translation parameters are defined, you can click the button in the different description windows of the project elements: this button allows you to use the software defined for translation.
Translation with WDMSG and WDTRAD
A tool named WDMSG (not supplied with WINDEV) can be used to:
- check out all project messages (caption of controls, code message, title of windows, ...) in order to translate them,
- check the translated messages back in.
- in a text format that can be configured to be used by most translation tools
- in HFSQL format.
Contact PC SOFT Sales Department for more details about WDMSG and WDTRAD.
Other elements to translate: the framework messages
Various information and messages are found in the WINDEV framework. For example, the names of days and months used by the functions for date management come from the WINDEV framework. To translate one or more libraries of this framework, you must use WDINT (not supplied with WINDEV).
This program is used to get a file whose extension is WDM. To use this file in your application:
- you have the ability to use LoadError.
- you can include the file in the project description in the "Languages" tab. Simply select the desired language and select the "Various" tab.
By default, the project is run in the runtime language defined for the project, in the "Languages" tab of the 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:
- Open the "WIN_Menu" window in the editor if necessary (double-click its name in the "Project explorer" pane).
- Click the "Menu" option of window. The menu is expanded.
- Select "Send an email".
- Display the popup menu (right click). Select "Add after". Type the caption ("Languages") and validate.
- Select the "Languages"' option you have just created.
- Display the popup menu (right mouse click) and select "Transform to expand a sub-menu".
- Type the caption of first sub-option: "English".
- Press the Enter key twice and type the caption of second option ("French").
Programming
To type the code for managing languages:
- Select "Menu .. Languages .. French" in the editor.
- Display the popup menu (right click). Select "Code".
- Write the following code:Nation(nationFrench)
- Select "Menu .. Languages .. English" in the editor.
- Display the popup menu (right click). Select "Code".
- Write the following code:Nation(nationEnglish)
Project test
Some application elements being translated, we are now going to check the change of language.
- To run the application test:
- Run the project test ( among the quick access buttons). The window is displayed in test mode in English.
- Select "Menu .. Languages .. French".
- The elements that have been translated are displayed in French:
- End the test and go back to the editor.
DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C
Nenhum comentário:
Postar um comentário