C # application for reading and translating other applications

I am trying to create a translation assistant that can read in another compiled C # application (.exe), and display forms from EXE, are displayed separately, together with the table next to it with an English column that shows the current English words on the display and another column for the value that the translator can enter. After the translation is completed, the translator can export the translations to a resx file, add to the project, and also as an excel file for recording.

I am new to C # and therefore not sure if my structure is correct, I designed it so that the dll is inserted into .exe at compiler time, and then using this DLL, the translation application can extract the string. This works for most lines, but it gets stuck where there are several lines that can appear in the same text field at different times (for example, disconnected, connected, etc.]. I tried searching everywhere, but I can’t find the information about how I can get all the lines out of the application and can determine what form they belong to to create my application?

Another problem I am facing is actually displaying translated strings, the application I am creating will be very useful if it could show an example of how translated strings look, since translations in some languages ​​can be excessively long. but I found that I can only read in aspects of compiled applications and instantiate, but I cannot translate it.

I read in exe using Reflection, and realized from online that I need to use reflection.emit to change the form. but I find every sting that is idenfitied from the form is retrieved as an instance, so changing the line only changes the instance of the rows, not the instance of the form itself. therefore, I can’t display it that way.

I tried for 3 weeks to solve these last two questions, in advance for help in resolving this.

+3
1

, , . :
, , , . , , . :

textBox.Text = GetCorrectText(connection.State);

GetCorrectText :

string GetCorrectText(ConnectionState state)
{
    return string.Format(Resources.ConnectionState, state);
}

Resources.ConnectionState " {0}".

, :

  • TextBox - ,
  • GetCorrectText , .
  • Method.Format . , string.Format , , .Format, .

- : , , - .

, .

0

Source: https://habr.com/ru/post/1792414/


All Articles