Let's discuss joint projects in the editor - why and where they are going - page 13

 
Artyom Trishkin:
There has already been an answer. Through compilation language defines. Things that should have multiple languages - settings for example - are written for each language.
Then #ifdef to help.
I don't understand a bit, is it possible to change the language of EA settings programmatically, depending on the terminal language ???
 
Vladimir Pastushak:
I'm a bit confused, is it possible to change the language of EA settings programmatically depending on the terminal language ???

Programmatically at the program level - no. At compile level, yes.

 
Artyom Trishkin:

Programmatically at the programme level, no. At compile level, yes.


I.e. if I have 54 settings in the program and I need to make several versions of the program in different languages, with different descriptions and different links, I do not need to translate and combine settings for each version?

 
Vladimir Pastushak:

I.e. if I have 54 settings in the program and I need to make several versions of the program in different languages, with different descriptions and different links, do I need to translate the settings and combine them for each version?

Yes, I do.

Everything that is displayed by the program during its operation can be linked to the terminal language, and the settings - only to the code itself. To do this, you need to make several versions of input parameters in the program and select the desired settings language by defining them during compilation.

 
Artyom Trishkin:

I have to.

Everything that is output by a program when it is running can be tied to the terminal language, and the settings are only tied to the code itself. To do this, you need to make several versions of input parameters in the program and select the desired settings language by defines when compiling.


I have no idea how... I seem to have a gap in my knowledge, can I ask for a small example ?

 
Vladimir Pastushak:

I have no idea how... I seem to have a gap in my knowledge, can I ask for a small example ?

Example:

//+------------------------------------------------------------------+
//| defines                                                          |
//+------------------------------------------------------------------+
#define __MQL_COMPILE_LANG__ // закомментировать для компиляции в eng
//+------------------------------------------------------------------+
//| Русский язык компиляции                                          |
//+------------------------------------------------------------------+
#ifdef __MQL_COMPILE_LANG__
   enum  ENUM_INPUT_YES_NO
     {
      INPUT_YES                        =  1,                // Да
      INPUT_NO                         =  0                 // Нет
     };
   enum ENUM_INPUT_ON_OFF
     {
      INPUT_ON                         =  1,                // Вкл
      INPUT_OFF                        =  0                 // Выкл
     };
   enum ENUM_INPUT_START_DAY_OF_WEEK
     {
      INPUT_WEEK_START_ON_SUNDAY,                           // Воскресение
      INPUT_WEEK_START_ON_MONDAY,                           // Понедельник
     };
   enum ENUM_USE_SYMBOL_LIST_FROM
     {
      INPUT_SYMBOLS_CURRENT,                                // Текущий
      INPUT_SYMBOLS_FROM_DEFINES_LIST,                      // Из заданного списка
      INPUT_SYMBOLS_FROM_MARKET_WATCH                       // Из обзора рынка
     };
   enum ENUM_USE_MAGIC_LIST_FROM
     {
      INPUT_MAGIC_ONE,                                      // Один заданный
      INPUT_MAGIC_FROM_DEFINES_LIST                         // Из заданного списка
     };
   enum ENUM_MONTH_NAME
     {
      MONTH_JANUARY,                                        // Январь
      MONTH_FEBRUARY,                                       // Февраль
      MONTH_MARCH,                                          // Март
      MONTH_APRIL,                                          // Апель
      MONTH_MAY,                                            // Май
      MONTH_JUNE,                                           // Июнь
      MONTH_JULY,                                           // Июль
      MONTH_AUGUST,                                         // Август
      MONTH_SEPTEMBER,                                      // Сентябрь
      MONTH_OCTOBER,                                        // Октябрь
      MONTH_NOVEMBER,                                       // Ноябрь
      MONTH_DECEMBER                                        // Декабрь
     };
//+------------------------------------------------------------------+
//| Английский язык компиляции                                       |
//+------------------------------------------------------------------+
#else 
   enum  ENUM_INPUT_YES_NO
     {
      INPUT_YES                        =  1,                // Yes
      INPUT_NO                         =  0                 // No
     };
   enum ENUM_INPUT_ON_OFF
     {
      INPUT_ON                         =  1,                // On
      INPUT_OFF                        =  0                 // Off
     };
   enum ENUM_INPUT_START_DAY_OF_WEEK
     {
      INPUT_WEEK_START_ON_SUNDAY,                           // Sunday
      INPUT_WEEK_START_ON_MONDAY,                           // Monday
     };
   enum ENUM_USE_SYMBOL_LIST_FROM
     {
      INPUT_SYMBOL_CURRENT,                                 // Current
      INPUT_SYMBOLS_FROM_DEFINES_LIST,                      // From the specified list
      INPUT_SYMBOLS_FROM_MARKET_WATCH                       // From the market watch
     };
   enum ENUM_USE_MAGIC_LIST_FROM
     {
      INPUT_MAGIC_ONE,                                      // One specified
      INPUT_MAGIC_FROM_DEFINES_LIST                         // From the specified list
     };
   enum ENUM_MONTH_NAME
     {
      MONTH_JANUARY,                                        // January
      MONTH_FEBRUARY,                                       // February
      MONTH_MARCH,                                          // March
      MONTH_APRIL,                                          // April
      MONTH_MAY,                                            // May
      MONTH_JUNE,                                           // June
      MONTH_JULY,                                           // July
      MONTH_AUGUST,                                         // August
      MONTH_SEPTEMBER,                                      // September
      MONTH_OCTOBER,                                        // October
      MONTH_NOVEMBER,                                       // November
      MONTH_DECEMBER                                        // December
     };
#endif 
 
Artyom Trishkin:

Example:


Thank you! I see, I thought there was something simpler...

If I forgot to take out the Russian version, I took it out, compiled the English one, if I forgot to take it out, I got a file in the same language...

I'm doing things a bit differently now, I'm trying to eliminate the mistakes I made on the fly...

I made my template-project and it looks like this

Project Expert

  • code folder
    • program code
  • include folder
    • settings in Russian
    • settings in English
  • russian version folder
    • Russian version of the program
  • English version of the program folder
    • English version of the program

It scares me a bit with what activity the developers started to do everything in projects and immediately made the program description on the main page of the project, which takes priority over the description which is in the code...

There is a risk that to create different versions of one program you have to make different projects and generate a bunch of folders and files...

 
Alexey Volchanskiy:

Why? Well, the pluses have done so historically, since the computers were weak and used split compilation. In addition you can pass to the customer in compiled format + headers in .h


Simple, it's convenient.

And on the plus side, it's still relevant today.

 
Artyom Trishkin:
There's already been an answer. Through the compilation language define. Things that should have more than one language - settings for example - are written for each language.
Then #ifdef to help.

I have long been putting settings in a separate .mqh file. There is a multiplatform core .mq4/5, it is ideally invariant, except for plugins, most of which are also multiplatform class definitions.

With this approach it is much easier to make a new robot, you just need to inherit from the signal class and write your own algorithm of opening/closing. And some cosmetics + sugar.

Made it all my own, as the classes concerning EA creation are one of the few things I strongly dislike about SB.

 
Vladimir Pastushak:

Thank you! I see, I thought there was something simpler...

If I forgot to take out the Russian version, I downloaded the excerpt, compiled the English one, if I forgot to take out the excerpt, I got a file in the same language...

I'm doing things a bit differently now, I'm trying to eliminate the mistakes I made on the fly...

I made my template-project and it looks like this

Project Expert

  • code folder
    • program code
  • include folder
    • settings in Russian
    • settings in English
  • russian version folder
    • Russian version of the program
  • English version of the program folder
    • English version of the program

It scares me a bit with what activity the developers started to do everything in projects and immediately made the program description on the main page of the project, which takes priority over the description which is in the code...

This threatens that to create different versions of the same program you will have to make different projects and multiply a lot of folders and files...


I agree, I don't write anything in this field, it's superfluous.

Reason: