Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

RTL languages subtitles show punctuation marks in reverse #409

Closed
dorsharon opened this issue Dec 15, 2017 · 58 comments
Closed

RTL languages subtitles show punctuation marks in reverse #409

dorsharon opened this issue Dec 15, 2017 · 58 comments

Comments

@dorsharon
Copy link

On the AndroidTV version of Plex, RTL subtitles (Hebrew, Arabic and more..) show punctuation marks at the start of sentences instead of at the end.

It'd be great if there was a setting to auto-reverse all downloaded RTL subtitles.

@pannal
Copy link
Owner

pannal commented Dec 15, 2017

Wouldn't that normally be something the subtitle creator should be doing?

I'm not at all familiar with RTL languages, so cut me some slack here please :)

Can you give me an example? Is the error inside the subtitle itself or does the Plex client behave wrong?

@dorsharon
Copy link
Author

No, the subtitle creator is doing what he should do, creating a sentence like this:

שלום לך.

However, the Plex decodes it as:

.שלום לך

which puts the period on the start instead of the end.
Other players will play Heb subs just fine. It's only Plex that doesn't.

@dorsharon
Copy link
Author

dorsharon commented Dec 15, 2017

If you'd like an example, you can download SubtitleEdit 3.5, where there's a feature under Tools for Reverse RTL:

image

@pannal
Copy link
Owner

pannal commented Dec 15, 2017

So the order of the characters in שלום לך. is already correct, and in .שלום לך it is as well, just the full stop should be at the end?

If you read from right to left, why wouldn't the full stop be on the left?

@dorsharon
Copy link
Author

The characters are in the right order, it's only punctuation marks that are supposed to appear at the end of sentences that are not right.

Most players usually recognize RTL languages and simply render the subtitles so that the period, commas etc. appear correctly.
Plex considers the heb subs as LTR and so doesn't reverses the punctuation.

@dorsharon
Copy link
Author

dorsharon commented Dec 15, 2017

So the order of the characters in שלום לך. is already correct, and in .שלום לך it is as well, just the full stop should be at the end?

That's correct

@pannal
Copy link
Owner

pannal commented Dec 15, 2017

Let me get this straight: ש is the first word/character you'd read in this example?

@pannal
Copy link
Owner

pannal commented Dec 15, 2017

Ah, you write/read from right to left, but the punctuation still occurs at the right, not the left?

@dorsharon
Copy link
Author

ש us the first character I'd read.
We read right to left, Punctuation occurs on the left.

@pannal
Copy link
Owner

pannal commented Dec 23, 2017

Wait, when punctuation occurs on the left, then .שלום לך is correct if I understood you fine.

@dorsharon
Copy link
Author

Yeah. Github actually also reversed my punctuation for my examples.
Bottom line is that period should occur on the left, Plex shows it on the right on AndroidTV

@pannal
Copy link
Owner

pannal commented Dec 23, 2017

OK. Is that the case with SZ subtitles only? I'm doing quite a bit of cleanup so I might kill the RTL marker in the process. Can you try downloading a subtitle manually from OpenSubtitles and see whether it really is Android TV which does that?

@dorsharon
Copy link
Author

I downloaded from OpenSubtitles and the subtitles there are fine.
Furthermore, on other platforms Plex plays the subtitles fine, It's the Android TV version that doesn't.

This issue isn't exclusive to SZ, I never said that it was.
I was simply asking for a feature of a setting to auto-reverse these punctuation marks, so that Israeli users can finally fully enjoy SZ, as well as arabic and others.

@pannal
Copy link
Owner

pannal commented Dec 23, 2017

This issue isn't exclusive to SZ, I never said that it was.

And I didn't say you did. I wanted to have as much information about the issue as possible, before I try and fix things :)

Edit: Can you attach an example subtitle so I can play around with it?

@dorsharon
Copy link
Author

@pannal
Copy link
Owner

pannal commented Dec 24, 2017

Please try the attached srt file. I've added an explicit RTL mark right after the first dot on:

4
00:00:08,230 --> 00:00:09,940
נראה שאתה לא מתייעץ איתנו
.‏בשום דבר

Does that work? If so, this modification could be very easy.

testout.zip

Edit: If not, the modifcation may be a bit more complex.

@dorsharon
Copy link
Author

I'll check later today

@pannal
Copy link
Owner

pannal commented Dec 26, 2017

Any news?

@dorsharon
Copy link
Author

Sorry about the delay, been crazy busy.
Unfortunately this still doesn't change anything. The problem persists.

@pannal
Copy link
Owner

pannal commented Dec 27, 2017

Damn. I'm not sure on how to approach this to be honest.
Your client seems to put the dot to the right side of the sentence explicitly, while the dot already being in the correct place (left side) inside the subtitle. I currently have no idea on how to circumvent that - have you actually had success in manually modifying a subtitle so it gets played correctly on your TV client?

Edit: I should have a look at what SubtitleEdit does.

@dorsharon
Copy link
Author

Yes, SubtitleEdit's feature does the job.
Just annoying having to do it every single time...

@pannal
Copy link
Owner

pannal commented Dec 27, 2017

OK I'm still not 100% sure why the SubtitleEdit approach works, simply because I have no experience with RTL languages. I think what it does it actually just putting the punctuation to the end of the sentence, explicitly, while keeping the rest intact.

Why that fixes things for you I still don't know, but if that's what you need, I can integrate it into SZ.

@dorsharon
Copy link
Author

Great! Looking forward to testing it out :)

@pannal
Copy link
Owner

pannal commented Dec 27, 2017

I think it'd be good if I separate the logic of the common modification for RTL and LTR languages, as they're currently only tested on LTR and probably won't work correctly on LTR. What do you think?

@dorsharon
Copy link
Author

Sounds about right

@pannal
Copy link
Owner

pannal commented Jan 5, 2018

Any update?

@dorsharon
Copy link
Author

Hi, sorry that I've been away. Life got in the way big time.
Anyway, I want to revisit this issue for a possible fix.
What do you need from me to continue?

@pannal
Copy link
Owner

pannal commented Mar 13, 2018

Can you re-download https://github.com/pannal/Sub-Zero.bundle/tree/heb_test? It should swap the dashes now, as well.

@pannal pannal added 2.5 and removed 2.0 labels Mar 17, 2018
@pannal
Copy link
Owner

pannal commented Mar 17, 2018

News?

@dorsharon
Copy link
Author

How do I mod the subs with your heb-fix?
I've installed your version.

@pannal
Copy link
Owner

pannal commented Mar 17, 2018

The same as before, go to an item in question using the SZ plugin menu, modify subtitle, Reverse punctuation in RTL languages.

@dorsharon
Copy link
Author

Yeah that solves the dashes as well :)

@pannal
Copy link
Owner

pannal commented Mar 17, 2018

Oh so that fix is working?

Do you want this to be a configurable default mod, that always gets applied to new subtitles, if enabled, or should I keep it manual?

@dorsharon
Copy link
Author

Enabled by default, can be disabled manually

@pannal
Copy link
Owner

pannal commented Mar 17, 2018

Well you will be able to enable it in SZ's settings, so it's applied by default. Then you can remove it for a specific item by going to the same menu you just went, and remove the mod.

@dorsharon
Copy link
Author

Fantastic

@pannal
Copy link
Owner

pannal commented Mar 17, 2018

I'll only enable this mod for Hebrew right now. If there are other languages where this applies, please give me a list.

@dorsharon
Copy link
Author

Alright

@pannal
Copy link
Owner

pannal commented Mar 17, 2018

This is properly implemented in this branch right now: https://github.com/pannal/Sub-Zero.bundle/tree/develop-2.5

And will be in the upcoming release. You can switch to that branch, it has the option to enable the modification by default (via SZ's settings).

@pannal pannal closed this as completed in e6900c1 Mar 24, 2018
@doopler
Copy link

doopler commented Aug 10, 2018

Hi this is a great add on to already great plugin. but i have noticed that not all punctuation marks are reversed. Can you add comma (,) and other marks like (:), ("), (-) this?
thank you

@Zuerrex
Copy link

Zuerrex commented Sep 3, 2018

Hello there,

Please note that Arabic suffer from the same issue as well. It will be great if you could fix Arabic subtitles.

The below languages are RTL but I cannot confirm if those languages suffer from the same issue:

  • Aramaic
  • Azeri
  • Dhivehi/Maldivian
  • Kurdish (Sorani)
  • Persian/Farsi
  • Urdu

Thanks

@AnewAlgerianboy
Copy link

AnewAlgerianboy commented May 12, 2019

Please try the attached srt file. I've added an explicit RTL mark right after the first dot on:

4
00:00:08,230 --> 00:00:09,940
נראה שאתה לא מתייעץ איתנו
.‏בשום דבר

Does that work? If so, this modification could be very easy.

testout.zip

Edit: If not, the modifcation may be a bit more complex.

Hi Pannal ,And Thank You For Your Help.
For Arabic It Work's ,Take A Look Your-Self

Before
Before

After
After

But Am Really NOOB At This Stuff
Can You Please Teach Me How To Do It

And What I Did In The Subtitle In The Photos Is I Paste The Subtitle Text In The File You Put In You Reply

@adirt4289
Copy link

any updates on this?

@pannal
Copy link
Owner

pannal commented Aug 28, 2024

No, this plugin is discontinued.

@adirt4289
Copy link

No, this plugin is discontinued.

so no sulotion for this problem?

@pannal
Copy link
Owner

pannal commented Aug 28, 2024

No, maybe try bazarr.

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

No branches or pull requests

6 participants