M
M
Maxim K2020-12-10 22:45:27
C++ / C#
Maxim K, 2020-12-10 22:45:27

How to design a word translator app?

Hello. I'm not asking you to write code for me, just how to properly design an application (classes, structures, etc.) according to OOP. They can stupidly make it a functional approach (as they did on delphi), but in C #, as I understand it, OOP is welcome. Appendix: English word on the left - translation on the right. I will enter my words, which will eventually appear on the screen - either in the database, or just a txt file with reading line by line. Maybe something on this site will do - https://refactoring.gu**/ (instead of ** ru). THANK YOU

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2020-12-11
@mkvmaks

> to make the functional approach (as did on delphi)
It is procedural. Though Delfi is able in OOP.
> (instead of ** ru)
You can give normal links to this site)
As I understand it, you want a translation by words, as in some Socrates.
In your case, it will be ok to have some kind of Translator class that will have a Translate method that translates all text and returns the translated text.
And the IWordTranslateProvider interface, which will provide a translation for each word - it will be possible to have an implementation to receive translations from the database or from a file.
Then in the GUI you will use the result received from the Translator
For Translator, you can also select an interface so that you can translate not by words, but, for example, use the API of some Google or Yandex translator.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question