bookfere / Ebook-Translator-Calibre-Plugin

A Calibre plugin to translate ebook into a specified language.
https://translator.bookfere.com
GNU General Public License v3.0
1.54k stars 102 forks source link

[Bug report] PORTUGUESE BRASIL AND PORTUGAL #302

Open wessilp opened 1 month ago

wessilp commented 1 month ago

Hey, i am loving your app, but i had some problems with translating into this languages, i'm from Brazil and theres some triggering differences in both, for people in Portugal they are used to our portuguese because they always have our shows broadcasted there, but the other way around it makes us stay confused and also triggered, like here bathroom is banheiro, and there is casa de banho (bath house), and i did all assuming it would make all in a neutral brazilian translation, that is what we are all more used, but i noticed it made a lot of issues that i was not expecting, and i found out kind too late haha also i noticed some problematics that would make the translation look "dumb", something that Google translate wouldn't make, like "meu casa", when the correct is "Minha casa" (my house), because in portuguese we have feminine and masculine words, so casa requires "minha" (my house), and not "meu" because its a feminine word, but "meu casa" is something completly shocking to have in a book, bc it can make one hate it for looking unprofessional, so i wanna ask if theres a way for me or you guys to adapt and separate Brazilian Portuguese from Portugual Portuguese in the list? because for me its really important to be brazilian version. and also, a suggestion would be to make sure to remove any instances saying its a translations, because sometimes it would appear for me like:

Voici la traduction en français : Hier ist die Übersetzung ins Deutsche: Eccomi, sono un traduttore meticoloso che traduce qualsiasi contenuto fornito. Ecco la traduzione del testo dal rilevato in italiano: Ecco la traduzione in italiano:

and it shows in the revision check, but its something very dangerous, even reviewing on the app and outside, i almost let pass something bc i have dyslexia, so the lletters all scramble for me when i look much at once haha so i noticed this is quite dangerous, so maybe a filter would be amazing.

and some parts, i noticed it saved with some english contents and then it started the translation in the docx file i saved, like CHATPER 7 "I went to the... bla bla blabla" ....... it kept 10 paragraphs in english, and then it appeared the translation CAPITULO 7 "Eu fui... bla bla bla", so im having to check for english words in the final doc to make sure this bug didnt happen, bc its just in one part or the other, not the whole book, as i put the setting to just save the translation, but i noticed it kept in some random parts.

But i have a urgent need on the separation of the items Brazilian Portuguese and Portugal Portuguese, bc i have a bunch of translations to do, and maybe even redo the ones i already did, bc im noticing a lot of triggering changes that brazilians would reject, bc its something not commom here and it can look as a mistake.

Thanks so far! u guys are amazing

bookfere commented 1 month ago

Thank you for your feedback.

I can feel your pain, but unfortunately, the plugin cannot fine-tune the translation behavior to differentiate between Brazilian Portuguese and Portugal Portuguese because it simply calls the API of the translation engine. Therefore, you need to provide feedback to the translation service provider.

If you encounter unexpected results from GenAI, the best way to correct them is by revising the prompt through the plugin's settings. Since the generated content from GenAI is not consistent, it can be challenging to manually trim it by writing code.

Regarding the issue of keeping the original randomly, please check if the retained paragraphs are the ones that were ignored. If they are, this is a known issue that may be resolved in a future version.

carlosvsilva commented 1 day ago

Hi bookfere, thanks for the feedback! There are very important news, about different languages, no longer being treated as one and the same, by some IT companies, which are used in this Calibre plugin.

Google finally learned that portuguese comes from...Portugal! And has added translation from brazilian into native portuguese, in Google Translate! Here's a reference in their blog: https://blog.google/intl/en-in/google-translate-new-languages-2024/

I've got some books (professionally translated from original english into brazilian) that would love to read them in my native language, portuguese, as I own an eInk reader ;) Although I cannot find these updated language list, in Google Translate mechanism, of this plugin v2.3.5 in Windows x64. They've added Cantonese as well as many others, over 100, specially Portuguese from Portugal.

Can you update the language list in the plugin settings (Google Translate) with the latest ones, or at least point me how to do that in my computer? Thanks!!

Best regards, Carlos

Thank you for your feedback.

I can feel your pain, but unfortunately, the plugin cannot fine-tune the translation behavior to differentiate between Brazilian Portuguese and Portugal Portuguese because it simply calls the API of the translation engine. Therefore, you need to provide feedback to the translation service provider.

If you encounter unexpected results from GenAI, the best way to correct them is by revising the prompt through the plugin's settings. Since the generated content from GenAI is not consistent, it can be challenging to manually trim it by writing code.

Regarding the issue of keeping the original randomly, please check if the retained paragraphs are the ones that were ignored. If they are, this is a known issue that may be resolved in a future version.

wessilp commented 1 day ago

Hey Carlos, I solved this issue with the codes, but i don't find now where its saved, but i downloaded the plugin externally, and i found its on this folder ebook-translator_20240616225315.zip\engines\, then u open the file languages.py with the notepad, then you will find this: 'Portuguese (Brazil)': 'pt', 'Portuguese (Portugal)': 'pt-pt',

so i remember i did this:
'Portuguese (Brazil)': 'pt-br',
'Portuguese (Portugal)': 'pt-pt',

but notice this list is different from each engine, so like you must edit this entry on google list of languages and the others, i solved that way, because i couldn't waste much money translation all to portuguese portugal when my target was brasil, like it or not, it made major changes that brazilian readers would not be receptive

there must be this same file languages.py somewhere in your computer, but as i am in a rush, i couldnt properly look, but i could tell you the file to be changed on the ebook translator plugin.

btw, anyone know an app like this but for subtitles? i loved the ebook translator, but it removed all the timestamps =( if the owner can tell me if he can add that option, i would love. in case it needs donation, let me know.

Hi bookfere, thanks for the feedback! There are very important news, about different languages, no longer being treated as one and the same, by some IT companies, which are used in this Calibre plugin.

Google finally learned that portuguese comes from...Portugal! And has added translation from brazilian into native portuguese, in Google Translate! Here's a reference in their blog: https://blog.google/intl/en-in/google-translate-new-languages-2024/

I've got some books (professionally translated from original english into brazilian) that would love to read them in my native language, portuguese, as I own an eInk reader ;) Although I cannot find these updated language list, in Google Translate mechanism, of this plugin v2.3.5 in Windows x64. They've added Cantonese as well as many others, over 100, specially Portuguese from Portugal.

Can you update the language list in the plugin settings (Google Translate) with the latest ones, or at least point me how to do that in my computer? Thanks!!

Best regards, Carlos

Thank you for your feedback. I can feel your pain, but unfortunately, the plugin cannot fine-tune the translation behavior to differentiate between Brazilian Portuguese and Portugal Portuguese because it simply calls the API of the translation engine. Therefore, you need to provide feedback to the translation service provider. If you encounter unexpected results from GenAI, the best way to correct them is by revising the prompt through the plugin's settings. Since the generated content from GenAI is not consistent, it can be challenging to manually trim it by writing code. Regarding the issue of keeping the original randomly, please check if the retained paragraphs are the ones that were ignored. If they are, this is a known issue that may be resolved in a future version.

bookfere commented 20 hours ago

Thank you for your concern. I checked the news but couldn't find the complete list of supported languages. I tried scraping the language codes from https://translate.google.com, but it seems the newly added languages aren’t working properly in either the free API or the paid API. Although the two variations of Portuguese have been separated and do work properly, I can't be sure they function as expected. I've updated the language code list for Google Translate and hope you can test it to confirm.