morpheus65535 / bazarr

Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.
https://www.bazarr.media
GNU General Public License v3.0
2.91k stars 226 forks source link

RTL Mod #1444

Closed A7med314 closed 3 years ago

A7med314 commented 3 years ago

Describe the bug The RTL mod does not seem to work. With Arabic I have tried downloading with RTL on or manually clicking the RTL after the sub is downloaded, still the punctuations are in their incorrect place.

morpheus65535 commented 3 years ago

I've just tried to manually run the RTL mod with that subtitles and they've got reversed without any issue: https://www.podnapisi.net/en/subtitles/ar-jumanji-welcome-to-the-jungle-2017/3kxF

Before:

37
00:04:19,242 --> 00:04:23,947
يسعدني سماع هذا
!(لكن (سبنسر غيلبين

After:

37
00:04:19,242 --> 00:04:23,947
يسعدني سماع هذا
(لكن (سبنسر غيلبين!
A7med314 commented 3 years ago

Actually, in the case you mentioned, the subtitle was already correct. Infact, the mod ruined it, you can see on the "after", there is '!' on the right side of the second line, whereas it was on the left side (the correct side). I was not aware that when the subtitle is correct, it would actually ruin it such in your case. Perhaps the mod is doing the opposite of what it is supposed to be doing?

The link below is an example of a subtitle that needs to be reversed, you will see '!' for example on the right side, where it would need to be on the left side instead.

https://subscene.com/subtitles/luca-2021/arabic/2506764

morpheus65535 commented 3 years ago

Here's the description for this mod:

Some playback devices don't properly handle right-to-left markers for punctuation. Physically swap punctuation. Applicable to languages: hebrew, arabic, farsi, persian.

There is no logic in there, it simply use regex to find punctuation mark on one side of a line and move it to the other side.

From what I can see, it's doing exactly that. Is that what you expected?

A7med314 commented 3 years ago

Thing is, it is not doing it when it is supposed to. The linked subtitle I put for the movie Luca has punctuation on the right side, it should find it and put it on the left, it does not do this. However, if a subtitle has correct punctuation on the left side, it will reverse it and put it on the right side. I don't know why.

morpheus65535 commented 3 years ago

This regex (^([\s.!?:,'-]*)(.+?)(\s*)(-?\s*)$) is made to find punctuation mark at the beginning of a line (^) and put it at the end($).

It may not be doing what you expect it to do but this is how it's been designed and, unless @pannal can explain what he had in mind when he wrote it, there's not much more I can tell about it.

morpheus65535 commented 3 years ago

I'll close this issue. If we got anything new, we'll re-open it.

pannal commented 3 years ago

This mod might not be the right way to do it for Arabic. It was pretty specifically designed for a single use case back then, and might not work as a generic solution.

IIRC it was for subs with a bad BOM.

morpheus65535 commented 3 years ago

@pannal thanks for the feedback!

pannal commented 3 years ago

Clarification: This was tested specifically with Hebrew subtitles for Android Plex.

It wasn't really maintained for anything else or specifically tested for other languages and clients.