Translate: Malformed
Describe the bug Translate from english to italian. Error report in log is:
BAZARR is unable to translate malformed subtitles: /media/plex/film/moviemedia/Sadistic - The Exorcism Of Lily Deckert (2022) {imdb-tt11443106}/Sadistic - The Exorcism Of Lily Deckert (2022) {imdb-tt11443106}.srt
To Reproduce Steps to reproduce the behavior:
- Go to Movie
- Click on '...'
- Click in menu on Translate
- Choose language italian
Expected behavior Translated movie subtitle
Software (please complete the following information):
- Bazarr: v1.4.3 2024-06-02 MASTER
Your subtitles is probably malformed as stated in log. I've just test with a random subtitles and it works as expected.
Your subtitles is probably malformed as stated in log. I've just test with a random subtitles and it works as expected.
Wat do you mean with malformd? I have the same issue with almost every subs. I`m trying translate to dutch.
Version: v1.4.3-ls254 by linuxserver.io
BAZARR is unable to translate malformed subtitles: /mnt/nfs/01-Movies/Late Night with the Devil (2024) {imdb-tt14966898}/Late Night with the Devil (2024) {imdb-tt14966898} [WEBDL-1080p][EAC3 5.1][h264]-BYNDR.en.srt
I have the same problem, using same Version: v1.4.3-ls254 by linuxserver.io I am trying to translate to french, though. The curious works to spanish (the current spanish subtitles was translated without problem from the same english source), but someway, the french is not working. It happens often with the tv shows. bazarr.log
Just create a new log using common fixes in the source subtitles and trying to translate, finally, after couple tries, it worked
bazarr-with-translation.log
Checking between the original subtitles and the fixed copy, I've found this difference
However, I want to point that the file was translated initially to spanish without problem
So, I don't think that it is the problem
Just try with another show, I usually translate to french and spanish. And this time, the french was translated, but not the spanish bazarr-evil.log I hope it helps.
I had this happen to me too, in my case I look at the subtitles and find many "—" at end of sentences. remove them all and then it was able to translate
I will check. However, previous version worked flawless. So, something changed in the code.
I've been able to reproduce the issue with a subtitles. I've made a small fix that seems to correct the issue on my side. Can you test upcoming beta and let me know?
I've just tested the v1.4.4-beta.11 and I cannot reproduce the issue. However, I would like to do more testing. I will update any findings. Thank you for your work and help.
I cannot reproduce the issue with the v1.4.4-beta.11. For my side, I think the problem was solved. Thank you again
@vincenzogianfelice can I close this issue as fixed?
@morpheus65535 I'll check in a couple of days and let you know. I can not at the moment
No news, good news!
I am having this same problem, English to French. Did anyone find a fix?
@morpheus65535 From the little I've tried (same film and same subtitles) the problem hasn't recurred. I will keep you updated if there are any problems. Sorry but between holidays and work now I don't have much time!
I am having this same problem, English to Portuguese. Even applying "Common Fixes" is not solving the problem.
Version: v1.4.4-beta.30
I had some problems too. But, it is more rare and complicated to reproduce. I usually translate from English to French and Spanish and I get one of the language translated, but the other not. I have to modify the original in other to get the second language translated. However, I didn't report it because I cannot reproduce the issue a will, like before
Finally, I was capable to reproduce the issue. I have this srt (from unknown movie)
Angels Fallen Warriors of Peace (2024) [WEBRip-720p] [YTS.MX].en.zip
And the log with the error:
bazarr.log
If I open the subtitle with Subtitle editor software, it doesn't show any problem, and even, I can translate with its tool without any issue. The subtitle, I think is the shd type, with a lot of words between square brackets. Not sure if it is the problem. Or maybe an special character.
I also have this problem, English to Thai. With almost all the translations. Sometimes I can try 3-4 times and then it works, but sometimes even after multiple attemps it won't translate. Applying "Common Fixes" is not solving the problem.
Version: v1.4.3
English to Dutch here same error, I'm on version 1.4.3. I just tested the committed fix, https://github.com/morpheus65535/bazarr/commit/9049ab2238c46355e6896ed07ebf4e66442a91af; and it works.
English to Dutch here same error, I'm on version 1.4.3. I just tested the committed fix, 9049ab2; and it works.
Yes, this also did the trick for me. Had problems translating from English to Dutch also. I run in Docker. What i did:
Log in to docker container with: docker exec -it bazarr bash Edit the file translate.py in directory: /app/bazarr/bin/bazarr/subtitles/tools Restart container
After that it works.
Also a side node. there is a line (47) with:
joined_lines_str = '\n\n\n'.join(lines_list)
I did not change this line. I only change like described in: https://github.com/morpheus65535/bazarr/commit/9049ab2238c46355e6896ed07ebf4e66442a91af
I'm testing it on the development branch, where there is this solution, but it doesn't work.
I applied the fix 9049ab2 It was working for some days. Now I have the issue again.
It was working for some days. Now I have the issue again.
Provide a new debug log reproducing the issue. I can't do anything with "I have the issue again".
bazarr.log I applied the fix like mentioned here https://github.com/morpheus65535/bazarr/issues/2519#issuecomment-2287119508
I applied the fix like mentioned here #2519 (comment)
2024-09-02 14:28:17|DEBUG |root |Bazarr version: 1.4.3|
You can't simply apply the fix, it will get overwritten. You either switch to nightly (dev branch) or you stay with master but you can't patch ti as you want.
Anyway, the translation process has been refactored and the fix you applied doesn't work anymore.
That makes sense. Thank you! EDIT: I switched to the dev branch. I'm on v1.4.4-beta.39 - Works flawless. Thank you again :)
I've been experiencing issues with some translations, I am using the latest beta version, particularly when handling special characters like "♪♪". After a detailed analysis, I've discovered that the problem lies with certain symbols. To further investigate, I added additional logging to the translate.py script to pinpoint the issue.
Here's an example from the log:
Exception on /api/subtitles [PATCH] | 2024-10-15 06:15:28
-- | -- | --
line_list=None | 2024-10-15 06:15:28 |
i=6 line=<SSAEvent type=Dialogue start=0:00:14 end=0:00:21 text='♪♪'> | 2024-10-15 06:15:28 |
line_list=[Acclamations et applaudissements] | 2024-10-15 06:15:28 |
i=5 line=<SSAEvent type=Dialogue start=0:00:12 end=0:00:14 text='[Cheers and applause]'> | 2024-10-15 06:15:28 |
line_list=C'est l'heure du « Scrabble ». | 2024-10-15 06:15:28 |
i=4 line=<SSAEvent type=Dialogue start=0:00:09 end=0:00:12 text='It\'s time for "Scrabble."'> | 2024-10-15 06:15:28 |
line_list=pour avoir une chance de gagner jusqu'à 10 000 $. | 2024-10-15 06:15:28 |
i=3 line=<SSAEvent type=Dialogue start=0:00:06 end=0:00:09 text='for their chance to win\\Nup to $10,000.'> | 2024-10-15 06:15:28 |
line_list=ces deux détectives de l'orthographe s'affrontent | 2024-10-15 06:15:28 |
i=2 line=<SSAEvent type=Dialogue start=0:00:04 end=0:00:06 text='these two spelling sleuths\\Nare going head to head'> | 2024-10-15 06:15:28 |
line_list=Et bien, nos joueurs aussi. Et ce soir, | 2024-10-15 06:15:28 |
i=1 line=<SSAEvent type=Dialogue start=0:00:02 end=0:00:04 text='Well, so do our players.\\NAnd tonight,'> | 2024-10-15 06:15:28 |
line_list=-Tu penses avoir un don avec les mots ? | 2024-10-15 06:15:28 |
i=0 line=<SSAEvent type=Dialogue start=0:00:01 end=0:00:02 text='-Think you have a way\\Nwith words?'> | 2024-10-15 06:15:28 |
BAZARR Log file emptied
As you can see, the original text is '♪♪', but the translated text is None, which leads to a replacement failure and results in the following error:
Exception on /api/subtitles [PATCH] Traceback (most recent call last):
File "/app/bazarr/bin/bazarr/../libs/flask/app.py", line 870, in full_dispatch_request
rv = self.dispatch_request()
File "/app/bazarr/bin/bazarr/../libs/flask/app.py", line 855, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/app/bazarr/bin/bazarr/../libs/flask_restx/api.py", line 402, in wrapper
resp = resource(*args, **kwargs)
File "/app/bazarr/bin/bazarr/../libs/flask/views.py", line 110, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
File "/app/bazarr/bin/bazarr/../libs/flask_restx/resource.py", line 41, in dispatch_request
resp = meth(*args, **kwargs)
File "/app/bazarr/bin/bazarr/api/utils.py", line 30, in wrapper
return actual_method(*args, **kwargs)
File "/app/bazarr/bin/bazarr/api/subtitles/subtitles.py", line 175, in patch
translate_subtitles_file(video_path=video_path, source_srt_file=subtitles_path,
File "/app/bazarr/bin/bazarr/subtitles/tools/translate.py", line 103, in translate_subtitles_file
line.plaintext = lines_list[i]
File "/app/bazarr/bin/bazarr/../libs/pysubs2/ssaevent.py", line 115, in plaintext
self.text = text.replace("\\n", r"\\N")
AttributeError: 'NoneType' object has no attribute 'replace'
Hope this help.
If you need the original str, let me know.
@resuarez it should be fixed in upcoming beta. Thanks for reporting.
That is great, I will test it. If I find anything, I will report it. Thank you