Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL Mod #1444

Closed
A7med314 opened this issue Jun 22, 2021 · 9 comments
Closed

RTL Mod #1444

A7med314 opened this issue Jun 22, 2021 · 9 comments

Comments

@A7med314
Copy link

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
Copy link
Owner

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
Copy link
Author

A7med314 commented Jul 2, 2021

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
Copy link
Owner

morpheus65535 commented Jul 2, 2021

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
Copy link
Author

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
Copy link
Owner

morpheus65535 commented Jul 15, 2021

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
Copy link
Owner

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

@pannal
Copy link
Collaborator

pannal commented Jul 19, 2021

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
Copy link
Owner

@pannal thanks for the feedback!

@pannal
Copy link
Collaborator

pannal commented Jul 20, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants