cerebro icon indicating copy to clipboard operation
cerebro copied to clipboard

Add default language to settings

Open KELiON opened this issue 7 years ago • 12 comments

Translate plugin uses default system language as default target. We should add a language dropdown in settings to allow changing this language.

KELiON avatar Feb 07 '17 10:02 KELiON

Wonderful idea :) The default target language is for me always russian btw. Seems like it does not use the system language...

Kageetai avatar Feb 07 '17 10:02 Kageetai

@Kageetai it's a bug, the workaround is to open Cerebro config file (~/.config/Cerebro/config.json on linux) and set lang property to the desired default language, then it will work. Whatever you change with Cerebro Settings only affects country, but not lang.

maximbaz avatar Feb 07 '17 23:02 maximbaz

@maximbaz I did not know about this settings file and just tried it on my windows, but it was already set to en ´en´ but still translates to russian on default. I will check on my work Mac tomorrow...

Kageetai avatar Feb 07 '17 23:02 Kageetai

Okay, are you trying to translate from english, and russian kicks in as a target language by default? If so, that is a bit different issue, explained in #5.

As of today, this lang setting only matters if you are translating from another language, so if you type "привет", the default language (which is english in your case) will be used as the target language.

This is how I understand it, at least :)

maximbaz avatar Feb 07 '17 23:02 maximbaz

Hmm okay, understood, but how do I translate something to English? For example I am trying to translate something from Spanish, because I am currently learning it, and therefore type for example novia in en but that just shows me the English -> English

screen shot 2017-02-08 at 11 03 41

Kageetai avatar Feb 08 '17 10:02 Kageetai

This is yet another issue in my mind, it's a problem of the service that is trying to guess the "source" language, and there is no way to enforce source language, so far as I can tell, maybe @KELiON can correct me.

maximbaz avatar Feb 08 '17 10:02 maximbaz

@Kageetai you described another problem. API of yandex.translate, that is used for translation, tries to guess source language automatically. Based on this language Cerebro tries to guess, what is target language. Examples:

Source: English System Language: English Target: Russian (just because Russian set in code as language with second priority after English)

Source: Spanish System Language: English Target: English

Source: Spanish System Language: Spanish Target: English

Problem is that API is not so good in guessing source language. I also learn Spanish and noticed that it is detected only when the input contains accents or ñ so in most cases, I have to change source language from English. The fastest way to do it just with keyboard (focus on translate results → arrow right → spa → enter).

KELiON avatar Feb 08 '17 10:02 KELiON

Just like cerebro parses "in" to get the target language, can it also parse "from" to enforce the source language? novia in en from spani should work.

maximbaz avatar Feb 08 '17 10:02 maximbaz

@KELiON hmm your last point about just changing the source language works, but I also just noticed a wrong translation from Yandex apparently with that :D I like @maximbaz 's idea

Kageetai avatar Feb 08 '17 10:02 Kageetai

+1, I'd add it. I just tried other language detection APIs (https://detectlanguage.com/, https://languagelayer.com/) and they also can't detect them properly in most cases

KELiON avatar Feb 08 '17 11:02 KELiON

What would be the workaround on Mac to make it use another language than Russian as a translation options ?

omartin avatar Feb 27 '17 08:02 omartin

there might be times when you want to use a different language as the source, but if the default is set in the settings then each time you start a new search it would switch back to that default. so remembering the last used language might be a better option? that way you could use spanish as the source for a while, then switch back to your default language once you are done.

it would be good if the target language would remember its last language as well

davebrny avatar Feb 27 '17 21:02 davebrny