sayonari / twitchTransFreeNext

MIT License
216 stars 103 forks source link

Not using deepl despite being set in config #41

Open hasen6 opened 2 years ago

hasen6 commented 2 years ago

config.py

# Select the translate engine ('deepl' or 'google')
Translator              = 'deepl'
# If you meet any bugs, You can check some error message using Debug mode (Debug = True)
Debug                   = True
lang_TransToHome        = 'zh'
lang_HomeToOther        = 'en'
lang_detect:zh-CN
--- Select Destination Language ---
lang_detect:zh-CN lang_dest:zh
lang_dest:zh in_text:我现在不可以
--- Translation ---
[Google Translate]
I can't
didotb commented 2 years ago

DeepL cannot translate a language back to the same language (e.g. zh -> zh). This is a DeepL limitation. If you would like that to change, please contact DeepL issue support instead.

hasen6 commented 2 years ago

In config.py it's set to this:

lang_TransToHome        = 'zh'
lang_HomeToOther        = 'en'

The output is English, it outputs "I can't", you can see that above in the debug output, but your debug outputs "[Google Translate]" even though it's set to "Deepl"..... and it says lang_dest is "zh" even though it's set to 'en'.

didotb commented 2 years ago

Because DeepL cannot translate anything back to the same language, the app automatically defaults to Google Translate. Google Translate will accept any input you put in language source and language destination. But in the backend if both source and destination is the same, OR if the language is not in the supported language database then it has a fallback. For destination language it is set to English, for source language it is set to Auto Detect

lang_dest is simply there to show that the language destination you have set was read by the app*. It does not mean the translator* is indeed translating to your desired language destination.

Programming problems like these confuses people and so was I. But if you carefully follow the process and logic of the translators used, you'll easily figure out why it was built in such way. 👍

* Notes: app : "app" in this case is sayonari/twitchTransFreeNext translator : "translator" in this case is Google Translate or DeepL

EDIT: Clarification

hasen6 commented 2 years ago

I really don't understand what you're saying. at all. I had the language destination set to English, if that's not right then how do I set it to English? You're saying it's translating from Chinese to Chinese but I have not done that....so why is it doing that?

How do I set it to translate from Chinese to English?

Are you saying there is a problem with your app so it can't use deepl? It shouldn't be translating from Chinese to Chinese, that would seem to be an internal error in your app.

didotb commented 2 years ago

The output is English,

So you meant I want the output to be English? Sorry, this line is what confused me. I thought the English output was undesired. Let me correct myself then.

lang_TransToHome        = 'zh'
lang_HomeToOther        = 'en'

This part of the config file means my language is zh so put destination language as zh. if in-case the source language is in zh translate it to en. However, Google Translate doesn't have zh it has zh-CN, there's an extra -CN and those two are different according to computers.

If you want the destination language to be en, config file should be like this

lang_TransToHome        = 'en'
lang_HomeToOther        = 'zh'
hasen6 commented 2 years ago

Ok yes it works now, that's great, thanks. However I think you should probably change lang_TransToHome and lang_HomeToOther to something else because they are very confusing. Trans to home? No idea what that's supposed to mean - what home? lang_TransToHome seems to mean the destination language so wouldn't it be better to call it destination_lang or something like that?

Anyway it's work now so that's good.

didotb commented 2 years ago

That will actually be confusing for most of us. lang_TransToHome as the name suggests means "My Primary language" while lang_HomeToOther as the name suggests means "From my language, translate it to the language that the rest of my chat understands"

Please close this issue if you have no other problem / question.

hasen6 commented 2 years ago

lang_TransToHome as the name suggests means "My Primary language"

?? Why would 'home' mean primary language? It doesn't suggest that at all.

while lang_HomeToOther as the name suggests means "From my language, translate it to the language that the rest of my chat understands"

Again the word 'home' has nothing to do with the words 'primary language' in English. I guess it means something in Japanese but in English it's meaningless, we never use the word 'home' to describe primary language. That's why it's so confusing.

Also 'other' is very confusing. It should be 'destination' or 'target' language. My native language is English btw, I'm just trying to help to make it less confusing since that's what caused the problem here.

hasen6 commented 2 years ago

This would be very clear:

lang_to_translate   = 'en'
target_lang      = 'zh'

Or

lang_to_translate  = 'en'
destination_lang   = 'zh'
didotb commented 2 years ago

mate it's just a variable name to make it easier to understand for people that doesn't speak English at all but knows a few common words.

?? Why would 'home' mean primary language? It doesn't suggest that at all.

Perhaps "The language I speak at my own HOME" would explain it to you?

hasen6 commented 2 years ago

mate it's just a variable name to make it easier to understand for people that doesn't speak English at all but knows a few common words.

It's my gf that is using your app and she is Chinese, only understands basic English and she didn't understand it since 'home' does mean 'native language' in Chinese either. So it's not clear for people that don't speak English well.

Perhaps "The language I speak at my own HOME" would explain it to you?

No I don't understand that, you mean you only speak it in your house? What about when you go outside? We use the words 'primary', 'maternal' or 'mother' language. In Chinese it's similar.

To make things clear in another language, even for those with basic English it's best to use standard words rather than something that is unique to Japanese like 'home language'...I've never heard of that before.

It you want to use something simple that everyone can understand I'd suggest using something like 'mother' language. That is simple and would be clear for everyone.

didotb commented 2 years ago

Japanese doesn't have home language either

hasen6 commented 2 years ago

Japanese doesn't have home language either

Well then why use it? It's not clear for anyone. :) If I only had basic English then I'm not gonna understand some rare term like that, best to stick with something simple like 'mother' language, that would be clear for everyone.

Anyway I'm not trying to cause any offense, your app is very good but the English was not clear for me or my Chinese gf so I'm just making suggestions as a native English speaker what would be clearer. :)

Maybe something like this then:

your_mother_lang  = 'en'
destination_lang   = 'zh'

or

your_mother_lang  = 'en'
target_lang   = 'zh'
didotb commented 2 years ago

well we just need to wait for sayonari to read this. and wait for his update.

sayonari commented 2 years ago

Thanks for the discussion.

It is difficult to name the settings. The meaning is already solved.

In detail, it is as follows

Long words like "destination" scare Japanese people. Is there any way to express this in a simple words?

2022年7月27日(水) 20:52 Andrew Barrientos @.***>:

well we just need to wait for sayonari to read this. and wait for his update.

— Reply to this email directly, view it on GitHub https://github.com/sayonari/twitchTransFreeNext/issues/41#issuecomment-1196628220, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2FCWLOQ7CGSHYJTDHSDELVWEPINANCNFSM53SAYY3A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- 西村 良太 (Ryota NISHIMURA) 徳島大学大学院社会産業理工学研究部 講師 @.*** 〒770-8506 徳島市南常三島町2丁目1番地 常三島地区 知能情報・南棟 C304号室 TEL:088-656-9446(大学内 内線:4717)

hasen6 commented 2 years ago

If you look at my second suggestion I used 'target' instead of 'destination' that is a simple word. Something like this then:

lang_TransToTarget        = 'zh'
lang_TargetToOther        = 'en'

Anyway it seems I still didn't understand the meaning of those two options.

In detail, it is as follows

  • Translate all languages into this language (standard language in chat): XX
  • Standard language in chat is translated into this language: YY

These two seem to do the same thing?

We want everything to be in English so I guess we need it to be:

lang_TransToTarget        = 'en'
lang_TargetToOther        = 'en'

Right?

didotb commented 2 years ago

These two seem to do the same thing?

You sound extremely confused. Please have fun modifying the config files and restart the app for every changes you make. This is the only way for you to fully understand how all those options work.

If you only want non-English to be translated into English, then you can do something like this

lang_TransToHome        = 'en'
lang_HomeToOther        = ''

The translator bot however will still detect the English and send an empty message that looks like this image

If you think that's annoying, you can add

Ignore_Lang             = ['en']

and that should ignore all detected English inputs and the bot wouldn't respond at all. Example: image

hasen6 commented 2 years ago

You sound extremely confused.

Well you were using the word 'home' to mean native language which nobody on Earth seems to use. It's hard to understand non native English speakers. Anyway sayonari seems keen to make it clear for people to use. Let's examine what was written:

Translate all languages into this language (standard language in chat): XX

Translate all languages - from where, not in the chat? We can only assume you meant this:

= Translate all languages spoken in the chat, into this language (standard language in chat)

So you mean this SETS the standard language for the chat?

Standard language in chat is translated into this language: YY

So the first setting sets the standard language and the second setting translates all languages into the standard language?

So basically you meant this:

standard language in chat  = 'en'
translate standard language to this language   = ''

Is that it?