ManeraKai / simplytranslate_mobile

Privacy friendly frontend to Google Translate
https://manerakai.github.io/simplytranslate_mobile/
GNU General Public License v3.0
173 stars 15 forks source link

Setting default language for translation #89

Closed Valdnet closed 3 years ago

Valdnet commented 3 years ago

When selecting a text for translation from another application, e.g. a web browser, the problem arises that if the translator has the languages set, eg French <-> German, and the text is in English and I want to translate it into Polish, it requires re-translation.

The suggestion is that in the application settings you can set the default language, e.g. Polish, to which you want to translate. After selecting the translator "Simply Translate", the application would automatically change the languages to: Autodetect <-> Polish. If the user changed to the default language e.g. Arabic, the translator would automatically change to Autodetect <-> Arabic.

I think it would make the application easier to use.

Valdnet commented 3 years ago

An example of setting the default language for translation in the application settings:

obraz

ManeraKai commented 3 years ago

You mean the default share language?

ManeraKai commented 3 years ago

I mean there should be an explanation that this setting is related to the share feature. Until now, this is the only thing this setting is used for.

Valdnet commented 3 years ago

I mean there should be an explanation that this setting is related to the share feature.

A very good point. I'll change the example in a moment πŸ˜‰.

ManeraKai commented 3 years ago

Has been added. The language search isn't the prettiest on the planet. It can be improved, but the logic is done, hopefully.

ManeraKai commented 3 years ago

https://github.com/ManeraKai/simplytranslate-flutter-client/actions/runs/1270492800

Valdnet commented 3 years ago

Errors: 1. After setting the default language, eg Polish, after exiting the settings, the Polish language is automatically set for translations.

Steps:

  1. Set the language to e.g. Polish.
  2. Exit the settings.

obraz

obraz

Correct behavior:

The default language should not be automatically set for translations. We get the result, for example: Polish <-> Polish.

2. The language set, for example: Polish, after re-entering the settings, it does not remember the language set. It returns to Arabic.

Steps:

  1. Set the language to e.g. Polish.
  2. Exit the settings.
  3. Enter the settings again.

obraz

obraz

Correct behavior:

Default language setting is remembered.

3. After setting the default language, e.g. Polish, translates the text into Arabic from the shared application.

obraz

obraz

Correct behavior:

After sharing text from another application, the languages should be set to: Autodetect <-> Polish. The translation should be for the Polish language.

ManeraKai commented 3 years ago
  1. I've encountered this issue, but happened just once. I think you've pressed the language from the options instead of pressing enter.
  2. Fixed by fixing the first one.
  3. Also Fixed by fixing the first one.
Valdnet commented 3 years ago

I've encountered this issue, but happened just once. I think you've pressed the language from the options instead of pressing enter.

Yes. I chose the language from the list. Choice should work that way too 😁.

ManeraKai commented 3 years ago

https://github.com/ManeraKai/simplytranslate-flutter-client/actions/runs/1270701311

Valdnet commented 3 years ago
  1. After re-entering, a list with language selection is displayed. The list should be displayed only after clicking on the window.

obraz

  1. Does not change the languages in the windows to Autodetect <-> Polish.

obraz

ManeraKai commented 3 years ago
  1. If you clicked on the TextField, it will display the list. I've made it to auto-focus when the dialog pops up. It auto focuses but doesn't do the other things and one of them is displaying the list. I'll try to fix that.
  2. They shouldn't be changed. The setting is for the share feature, not the usual translation.
Valdnet commented 3 years ago

They shouldn't be changed. The setting is for the share feature, not the usual translation.

Hmmm. It looks a bit strange, but maybe you're right πŸ˜‰. We will see in the tests how it turns out 😁.

Valdnet commented 3 years ago

The choice of the default language should be done in the same way as for the choice of the translation languages.

Procedure:

  1. Tap on default language settings - "Default share to-language".
  2. A window with the set language should appear.

No expanded list:

obraz

  1. Tap on the language selection window.

The list with the languages is shown:

obraz

  1. Language selection. The list with the selection window closes.
ManeraKai commented 3 years ago

It was like that before. Reverted it back.

Valdnet commented 3 years ago

Previously, this was the case with the tap in "Default share to-languaguage":

obraz

And it should be like this:

obraz

The point is, once the popup shows up, it shouldn't automatically expand the language list or the selected language. Only after tapping on the language window is the list of languages ​​drawn up. As it is for the choice of languages ​​for a translator.

Valdnet commented 3 years ago

One more thing needs to be improved. The first time you set it, the default language should appear in the window so that the user knows.

obraz

Currently it is like this:

obraz

Because the language is also visible to the user in the settings:

obraz

Do the languages displayed in the settings need to be re-translated?

ManeraKai commented 3 years ago

Do the languages displayed in the settings need to be re-translated?

I took care of this. They're translated now.

ManeraKai commented 3 years ago

Won't appear until the user presses the TextField. will show the whole list. Fresh startup of the app will default to Arabic. Will be shown in the TextField and in the settings subText.

ManeraKai commented 3 years ago

https://github.com/ManeraKai/simplytranslate-flutter-client/actions/runs/1272712142

Valdnet commented 3 years ago

In this case, the fixed text "Select language" must be entered for the first commissioning. The empty window looks a bit strange. The user may be a little confused.

obraz

Although I would prefer the language name "Arabic" 😁.

I took care of this. They're translated now.

They are still in English:

obraz

ManeraKai commented 3 years ago

The empty window looks a bit strange.

I did change it.

Although I would prefer the language name "Arabic" grin.

Me too, that is what was implemented.

They are still in English:

I downloaded the last artifact and checked. It really is translated.

Valdnet commented 3 years ago

I downloaded the last artifact and checked. It really is translated.

But in the latest test version it still displays in English. Are you sure it gets from text strings from selectLanguagesMap?

ManeraKai commented 3 years ago

It doesn't. It gets it from a variable called toLanguageShareDefault.

ManeraKai commented 3 years ago

It's the same value that you typed in the TextField. If it's angelize then it will be angelize. Values that are shared with servers use the selectLanguagesMap. They take this gibberish translation and find the corresponding English name. Send those English names to the servers because they just speak English.

Valdnet commented 3 years ago

Hmmm … Check if your languages are translated in the settings πŸ˜‰.

ManeraKai commented 3 years ago

I checked it in polish.

Valdnet commented 3 years ago

I checked it in polish.

Well. When there is a new test version, I will test it again πŸ˜‰.

Valdnet commented 3 years ago

Cool. There is a translation of the set language πŸ‘ . Only the text string goes out of the window.

obraz

Valdnet commented 3 years ago

Automatic translation cancellation for sharing. Same as for issue #99 😁.

ManeraKai commented 3 years ago
ManeraKai commented 3 years ago

Fixed it but referenced in that issue.

ManeraKai commented 3 years ago

I think this issue should be closed now @Valdnet.

Valdnet commented 3 years ago

After many torments, I am happy to close the issue 😁. Many thanks to @ManeraKai πŸ₯‡.

ManeraKai commented 3 years ago

Hoping the same for the Paste button one day.