muzuiget / dualsub-support

Dualsub - Dual Subtitles for YouTube
https://www.dualsub.xyz/
272 stars 23 forks source link

Feature request: Create your own Preferred Language List #578

Closed idanrm closed 5 months ago

idanrm commented 5 months ago

I think it would be great if you could edit the current list of preferred languages, i.e. each user creates their own preferred language list.

Thanks

muzuiget commented 5 months ago

The preferred languages is your browser preferred languages, you can add your languages in the browser setting page.

Screenshot_20240201_185029

Doc: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/languages

idanrm commented 5 months ago

I understand, thank you. The preferred language list is indeed as configured in my browser, however Hebrew is configured in my browser but is missing in the extensions' preferred language list. What could be the issue, then?

Thanks

muzuiget commented 5 months ago

Switch the Dualsub setting option to All Available Languages, can you see the Hebrew menuitem?

idanrm commented 5 months ago

Yes, I can see it. I personally have no problem with continuing using the All Available Languages option, however maybe it's worth looking into this bug.

muzuiget commented 5 months ago

Screenshot_20240201_193246

Hebrew has two language codes: he and iw.

I believe the issue arises because the browser uses he, while Dualsub uses iw, leading to he being treated as an unsupported language code and consequently filtered out.

muzuiget commented 5 months ago

You can test it in the DevTools:

Screenshot_20240201_194005

idanrm commented 5 months ago

If so, then why does Dualsub use 'iw' instead of 'he'? As far as I can see, 'iw' is the old ISO-639 language abbreviation for Hebrew and 'he' is the new one. As a speaker of Hebrew, I seldom see 'iw' being used as the language abbreviation.

muzuiget commented 5 months ago

The current language code list was "copied" from Google many years ago. If backward compatibility is not a concern now, we can consider switching to he in the next version.

muzuiget commented 5 months ago

This is fixed in 2.23.0.