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

Use system language as a default for translations #153

Closed Aga-C closed 2 years ago

Aga-C commented 2 years ago

Hi,

I think that a useful improvement of the app would be to use system language as a default one for:

It will be more user-friendly, since probably most use-cases will be translating from "auto-detect" to mother tongue of a user. Now by default in both cases is Arabic.

Valdnet commented 2 years ago

@Aga-C Very good idea :+1:. I also believe that it will make it easier for the user to use the application.

Maybe ManeraKai wants to promote their language (joke) :grin:.

ManeraKai commented 2 years ago

I will take some time on this as I want to make the language values that are now Arabic, Spanish as ar, es

ManeraKai commented 2 years ago

Did it in this commit: https://github.com/ManeraKai/simplytranslate_mobile/commit/e388b13d86369c91e661d6413ddd6ccd4145c047 I should to fix some translations issues before I'm able to compile an .apk, it's giving me errors now.

ManeraKai commented 2 years ago

Fixed those errors in: https://github.com/ManeraKai/simplytranslate_mobile/commit/ed0c23965cee48590b0f2d932543d28f7eff06ec .apk: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1429116641

Aga-C commented 2 years ago

I've tested on a device and on an emulator - translation doesn't work at all πŸ™

ManeraKai commented 2 years ago

This is just temporarily. It should be POST.

ManeraKai commented 2 years ago

https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1429195278

Aga-C commented 2 years ago

Now it works ok. BTW. There is an unrelated issue - all 3 language lists are not sorted alphabetically.

ManeraKai commented 2 years ago

Hopefully: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1429231236

Aga-C commented 2 years ago

Works great, thanks πŸ‘

Valdnet commented 2 years ago

After this change, it is possible to select "Autodetect" for the language to which the text is to be translated. This selection should not appear for this window.

Additionally, when selecting "Autodetect" for the source language, change the <--> button to inactive, because you cannot change the languages ​​between, for example: "Autodetect" <--> "Polish".

Aga-C commented 2 years ago

After this change, it is possible to select "Autodetect" for the language to which the text is to be translated.

And it's also visible in selecting language for share.

Valdnet commented 2 years ago
  1. Also the language for shares that is automatically detected is gray. After changing to a different language and selecting your language again, you cannot select it.

obraz

  1. After selecting the language, the window does not close automatically as it was before.
ManeraKai commented 2 years ago

About the autodetect. It really is weird . It's treating passed variables as pointers.

fromSelLangMap = toSelLangMap;
fromSelLangMap['auto'] = AppLocalizations.of(context)!.autodetect;

Apparently this changes both fromSelLangMap and toSelLangMap, treating toSelLangMap as a pointer rather than a value.

I fixed it by a workaround btw.

ManeraKai commented 2 years ago

Forgot to mention this commit https://github.com/ManeraKai/simplytranslate_mobile/commit/9249337e9e1bb38f2067c283ddf150f24e1dff45 Fixed: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1430159688

Valdnet commented 2 years ago
  1. The <--> language swap button does not change languages, but translates the text.

  2. You can type and set different characters for the language.

obraz

Maybe it is left so that you can set your own unofficial language (joke) 😁.

ManeraKai commented 2 years ago

Fixed: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1431163568

Valdnet commented 2 years ago

Works correctly πŸ‘.