plugin.video.netflix icon indicating copy to clipboard operation
plugin.video.netflix copied to clipboard

The Chinese subtitles tracks are not selected automatically

Open MAN-GOR opened this issue 2 years ago • 11 comments

Netflix add-on version

1.18.6

Operative systems used

Android, Windows

Kodi version used

Kodi 19 (Matrix)

Description of the bug

  1. I selected "Chinese (Traditional)" as preferred language for subtitles in the Kodi settings. When I play a video in the Netflix addon the subtitles are turned off. I have to manually select "Chinese - Hant".

  2. I selected "Chinese (Simple)" as preferred language for subtitles in the Kodi settings. When I play a video in the Netflix addon the subtitles are turned off. I have to manually select "Chinese - Hans".

Steps to reproduce the behavior

  1. Change "Interface > Regional > Language" to "Chinese (Traditional)" Select "Chinese (Traditional)" as preferred language for subtitles in the Kodi settings. Play a video in the Netflix addon which has an "Chinese - Hant" subtitle track.

  2. Change "Interface > Regional > Language" to "Chinese (Simple)" Select "Chinese (Simple)" as preferred language for subtitles in the Kodi settings. Play a video in the Netflix addon which has an "Chinese - Hans" subtitle track.

Debug log - mandatory

https://paste.kodi.tv/dasicucana.kodi

Possible fix

No response

Additional context

No response

Screenshots

螢幕擷取畫面 (3) 螢幕擷取畫面 (4)

MAN-GOR avatar May 25 '22 05:05 MAN-GOR

this is a know problem since Kodi not support country codes so kodi seem to support only zh-cn/zh-tw

one solution already adopted in another similar situation is replace zh-Hant with zh-cn zh-Hans with zh-tw

but i also know that exists more macrolanguages like zh-CN, zh-HK, ... is possible that there is only hant/hans language in catalogue but i am not sure

can you check if you are able to find other type of chinese macrolanguage in catalogue? maybe try check also some old chinese movie?

please check also on audio languages

CastagnaIT avatar May 29 '22 09:05 CastagnaIT

if no response in next days this will be closed and not fixed since there is no collaboration

CastagnaIT avatar Jun 05 '22 14:06 CastagnaIT

Sorry for not replying before. There are no errors in audio language.

There are only "Chinese - Hant" and "Chinese - Hans" in the catalog.

If it is a kodi problem and cannot be solved, at least select a random "Chinese" subtitle track and display the subtitles. Now the subtitles will not be displayed and need to be turned on manually.

MAN-GOR avatar Jun 06 '22 05:06 MAN-GOR

is not what i asked in my previous comment, i try reformulate my question:

can you check if you are able to find other types of chinese audio/subtitles languages other than Hant/Hans in video catalogue and specify the names?

If it is a kodi problem and cannot be solved,

already reply in to my previous comment, its a kodi bug that cannot be solved due to unsupported language format type the only thing we can do is apply a workaround and try to see if the situation will be better

CastagnaIT avatar Jun 06 '22 06:06 CastagnaIT

I only found "Chinese - Hant" and "Chinese - Hans" in the Chinese subtitle language of the video catalogue, no other types just like this picture image

The Chinese audio language in the video catalogue is only "Chinese - DD+ - 2 channels", and the current add-on can automatically select the Chinese audio track

MAN-GOR avatar Jun 06 '22 08:06 MAN-GOR

thanks, i tried do go deeper for your use case

your languages "Chinese (Traditional)" and "Chinese (Simple)" are language packages installed separately in kodi

so as first, i tried replace the language code of subtitles with the language code of packages (zh_CN, zh_TW) as mentioned before, and i have discovered that Kodi has an additional bug, so is not able to detect and select the languages installed as package, so replacing the language code from the addon does not work either...

moreover also Kodi python module xbmc.convertLanguage have the same bug, by returning an empty string instead of the language code of the language package

for the time being an appropriate solution is not possible without create a very nasty hack to falsify the language codes that suspect also will works partially, and having several language workarounds already i think will only cause more confusion

therefore a appropriate solution will take time because will need to be fixed as first in kodi core I will try to open a bug issue in Kodi when i can

CastagnaIT avatar Jun 06 '22 14:06 CastagnaIT

Hello, I found a very good function in the addon of Disney+, I wonder if you will consider adding a similar function? It can display only the language tag you typed, e.g.

My preferred language for subtitles is "Chinese", 螢幕擷取畫面 (22) but the video will not automatically select "Chinese (Traditional)" subtitles, but "Chinese (Hong Kong)" (Because "Chinese (Hong Kong)" is above other Chinese, "Chinese (Hong Kong)" will be automatically selected) 螢幕擷取畫面 (23) However, if I enter "zh-hant" in the "Subtitle Allow List", 螢幕擷取畫面 (24) the subtitles in the video will only have "Chinese (Traditional)" KODI will be forced to choose this subtitle 螢幕擷取畫面 (25)

And can automatically select unknown audio languages, such as Cantonese Cantonese will be displayed as "unknown" in KODI, so the audio preferred language cannot automatically select "Cantonese" unless the language tag "yue" is added in "advancedsettings.xml" 螢幕擷取畫面 (26) But as long as you enter "yue" in "Default Audio", 螢幕擷取畫面 (27) the video will automatically select this unknown audio language 螢幕擷取畫面 (28)

Thanks For Reading

MAN-GOR avatar Jul 06 '22 18:07 MAN-GOR

this is another workaround that force kodi to select a language the hours needed to implement a kind of thing on each addon is better invest in to fix the problem in kodi itself...

CastagnaIT avatar Jul 07 '22 06:07 CastagnaIT

I know But even if KODI fixes the language code issue, my "preferred subtitle language" will select "Chinese" instead of "Chinese (Traditional)" or "Chinese (Simplified)"

Since I am from Hong Kong, I can also read "Chinese (Hong Kong)" and "Chinese (Traditional)" ("Chinese (Hong Kong)" is similar to a variant of "Chinese (Traditional)") But of course the preferred language will be "Chinese (Hong Kong)"

Although there are some videos in "Disney+" that have "Chinese (Hong Kong)" 螢幕擷取畫面 (31) However, some videos do not have "Chinese (Hong Kong)", only "Chinese (Traditional)" 螢幕擷取畫面 (32) So I will enter "zh-hk,zh-hant" in "Subtitle Allow List" (“Chinese (Hong Kong)” and “Chinese (Traditional)”) 螢幕擷取畫面 (34) When I select "Chinese" as my "Preferred subtitle language" 螢幕擷取畫面 (35) "Disney+" will automatically select "Chinese (Hong Kong)" (Because the selection position of "Chinese (Hong Kong)" is higher than "Chinese (Traditional)) 螢幕擷取畫面 (36) If the subtitle does not have "Chinese (Hong Kong)", "Chinese (Traditional)" will also be automatically selected 螢幕擷取畫面 (38)

So if KODI fixes the language code problem of "Chinese (Traditional)" and "Chinese (Simplified)", and my "Preferred Subtitle Language" also selects "Chinese (Traditional)" 螢幕擷取畫面 (39) According to my estimation, Although in "Netflix", the video can automatically select "Chinese (Traditional)" 螢幕擷取畫面 (41) But at the same time, "Disney+" videos will also automatically select "Chinese (Traditional)" instead of "Chinese (Hong Kong)" 螢幕擷取畫面 (43)

If want to solve the problem of KODI itself, probably only KODI adds "Chinese (Hong Kong)" to "Preferred Audio and Subtitle Language", and also adds "Secondary Audio and Subtitle Language"

e.g. My "Preferred Subtitle Language" select "Chinese (Hong Kong)", and "Secondary Subtitle Language" select "Chinese (Traditional)"

Sounds like KODI issue, so I should post on the KODI side?

Or if want to solve the problem in the addon, maybe only can add functions similar to "Subtitle Allow List"?

MAN-GOR avatar Jul 07 '22 18:07 MAN-GOR

@MAN-GOR matthuisman's solution does bypass Kodi to solve the problem, but it doesn't apply to other Add-ons I think to fix it once and for all, we need to go to https://github.com/xbmc/xbmc/issues https://forum.kodi.tv/ suggest Kodi improvements. I agree that the issue should be fixed in Kodi. And Kodi needs to be extended to classify Chinese.

There are different variants of Chinese for different countries and regions, e.g. Mainland China, Hong Kong, Macau, Taiwan, Malaysia, Singapore are all different. The region codes are CN, HK, MO, TW, MY, SG.

I think the subtitle language can be expanded from the current Chinese, Chinese (Simplified), Chinese (Traditional) to Chinese - Simplified - CN, Chinese - Simplified - MY&SG, Chinese - Traditional - HK&MO, Chinese - Traditional - TW, for Cantonese I know less, I think a single Chinese - Yue(or Cantonese) is enough. The audio language should be expanded from the current Chinese, Chinese (Simplified), Chinese (Traditional) to Chinese - Mandarin - CN, Chinese - Mandarin - TW, Chinese - Mandarin - MY&SG, Chinese - Cantonese "Simplified“、“Traditional”, which describes written language rather than audio.

Consider that in most cases, multiple variants will not be available at the same time. So I think according to the user-set audio and subtitle language, the priority is to match the regional variants, followed by the same glyphs. If not found in matching other glyphs that may exist (e.g. Simplified does not exist, match Traditional), the same for Mandarin.

See https://en.wikipedia.org/wiki/Sinitic_languages

Liqianyu avatar Jul 08 '22 20:07 Liqianyu

@Liqianyu yeah i have already opened an Issue https://github.com/xbmc/xbmc/issues/21533 more or less i have understand what changes are needed in kodi core when i will have time for this i will try to implement a way to get language code of installed language packages in the missing parts of kodi

for glyphs of fonts is a whole other thing, for subtitles this should works already just add the appropriate fonts in kodi fonts folder, at least this works for Kodi 20, for GUI font purpose the thing is different, and require a massive change in Kodi, someone has already proposed a change but incomplete, more likely will be done in the future Kodi 21

CastagnaIT avatar Jul 11 '22 07:07 CastagnaIT

hi @MAN-GOR sorry for the delay but i had a lot of other works to do

i have fixed kodi (PR 21776) so now should works as expected these are the test builds, choose the preferred: Windows64: http://mirrors.kodi.tv/test-builds/windows/win64/KodiSetup-20220823-df3a4336-language_fix-x64.exe Android ARM: http://mirrors.kodi.tv/test-builds/android/arm/kodi-20220823-df3a4336-language_fix-26346-armeabi-v7a.apk Android ARM64: http://mirrors.kodi.tv/test-builds/android/arm64-v8a/kodi-20220823-df3a4336-language_fix-23855-arm64-v8a.apk

I would appreciate feedback from some of you

@Liqianyu i dont think that a video service provide all that language variants, anyway with my fix now we have two new options to fix the unsupported country code in kodi:

  1. install language addons packages to add support the required language
  2. add in the advanced settings xml the language codes needed, since now add languagecode+countrytag works (e.g. pt-br)

now unrecognized country language code are shown without misspellings so as is, e.g. pt-br ---instead of--> Portuguese - Breton --is shown as--> Portuguese - br

CastagnaIT avatar Aug 23 '22 15:08 CastagnaIT

thank you very much @CastagnaIT But am I missing something?

I uninstalled "KODI 19" Then install the "KODI 20 Windows 64 exe" provided by you "Chinese (Simplified)" and "Chinese (Traditional)" language packs installed 螢幕擷取畫面 2022-08-24 053633 and define the language code in "advancedsettings.xml" My "Preferred Subtitle Language" select "Chinese (Traditional)" or "MyCustomDesc(zh-tw)" 螢幕擷取畫面 2022-08-24 052351 But I tested a lot of possibilities and it didn't work either 螢幕擷取畫面 2022-08-24 053342 螢幕擷取畫面 2022-08-24 053511 螢幕擷取畫面 2022-08-24 053536 螢幕擷取畫面 2022-08-24 053809

MAN-GOR avatar Aug 23 '22 21:08 MAN-GOR

i will try check i have tested only web streams, so not file

however from the screenshot your file looks weird seems there are too many language code duplicates with same properties

CastagnaIT avatar Aug 24 '22 06:08 CastagnaIT

i will try check i have tested only web streams, so not file

however from the screenshot your file looks weird seems there are too many language code duplicates with same properties

Because this is what I created to test which subtitle will be selected successfully.

On the version you gave me, my "Add-ons" cannot display zip files, but in the "File manager" it can display. So I can't install "Add-ons" to test streaming.

But my first test was to upgrade from "kodi19" to "kodi20", and my kodi19 has installed streaming "add-ons". Unfortunately, it doesn't work on streaming either. At the time I thought it was because of a bug in upgrading from "kodi19" to "kodi20", so I uninstalled and reinstalled.

MAN-GOR avatar Aug 24 '22 10:08 MAN-GOR

you have right there is a bug in kodi that not allow show the .zip files (just fixed)

on what concern the problem with video files unfurnately the problem is in ffmpeg library that kodi uses, and this cannot be fixed by our part but, i have add a possible workaround, to allow kodi recognize the right language code,

the workaround consists in to add the language code on the track "title", as following example: (zh-tw) so please try edit your video file remove the duplicates subtitles and put also in the "title" tracks the language code enclosed with brackets

This is the new build with all fixes: http://mirrors.kodi.tv/test-builds/windows/win64/KodiSetup-20220824-6bf6426b-language_fix-x64.exe

CastagnaIT avatar Aug 24 '22 12:08 CastagnaIT

umm... Let me check again. After installing the kodi 20 you provided, I need to switch "Language" to "Chinese (Traditional)" in "System>Interface>Regional" to install the language pack. Then switch the "Preferred subtitle language" to "Chinese (Traditional)" in "System>Player>Language", Or create a new file "advancedsettings.xml" and switch "Preferred subtitle language" to "MyCustomDesc(zh-tw)". Finally, the add-ons of "Netflix" should automatically select "Chinese (Traditional)" subtitles.

But I tested it and I couldn't successfully select "Chinese (Traditional)" automatically... Should I enable debugg logging to provide log files?

MAN-GOR avatar Aug 27 '22 08:08 MAN-GOR

you pointed out a problem i had not seen, i will check,

since you have installed the language pack can you testing by removing lang values in advancedsettings.xml?

CastagnaIT avatar Aug 27 '22 08:08 CastagnaIT

Do you mean delete the "advancedsettings.xml" file and only switch the "Preferred subtitle language" to "Chinese (Traditional)" in "System>Player>Language"? Or something else? Sorry I don't quite understand.

If yes, I've tried switch the "Preferred subtitle language" to "Chinese (Traditional)" in "System>Player>Language", but it still doesn't automatically select.

MAN-GOR avatar Aug 27 '22 08:08 MAN-GOR

to be sure remove advancedsettings.xml file, then when you run kodi make sure that in the "Preferred subtitle language" is set "Chinese (Traditional)"

CastagnaIT avatar Aug 27 '22 09:08 CastagnaIT

I can confirm that the "advancedsettings.xml file" has been deleted. I even uninstalled and deleted all user data, then reinstalled. Switch "Language" to "Chinese (Traditional)" in "System>Interface>Regional" to install the language pack. Switch the "Preferred subtitle language" to "Chinese (Traditional)" in "System>Player>Language" But it still fails to automatically select "Chinese (Traditional)"

MAN-GOR avatar Aug 27 '22 09:08 MAN-GOR

i am not able to reply your problem to me works as expected please disable all following addon settings as shown below, and try again immagine and also please give me the title of your movie, in hoping is not geo locked

CastagnaIT avatar Aug 27 '22 09:08 CastagnaIT

No luck for me. The TV show I tested was "Chesapeake Shores" S06 螢幕擷取畫面 (55) 螢幕擷取畫面 (58) 螢幕擷取畫面 (56) 螢幕擷取畫面 (57)

MAN-GOR avatar Aug 27 '22 09:08 MAN-GOR

ah ok now its clear this is right because in Kodi Chinese (Traditional) is the language code "zh-tw" and Chinese (Simple) is the language code "zh-cn"

but netflix stream use these subtag "Hans"/"Hant" in this use case you have to add in the advancedsettings.xml this:

<advancedsettings>
<languagecodes>
  <code>
    <short>zh-Hant</short>
    <long>Chinese (Traditional)</long>
  </code>
  <code>
    <short>zh-Hans</short>
    <long>Chinese (Simple)</long>
  </code>
</languagecodes>
</advancedsettings>

CastagnaIT avatar Aug 27 '22 09:08 CastagnaIT

Thank you, It work now. The current "advancedsettings.xml" successfully automatically selects "Chinese (Traditional)" But I still don't know how to automatically select "Chinese (Traditional)" subtitles for local files, whether it is the previous "zh-tw" or the current "zh-Hant"

MAN-GOR avatar Aug 27 '22 10:08 MAN-GOR

For local files you have the needed to edit the file itself, for example with MKVToolNix software

immagine

POST edit: and add in the track "title" or "name" (depends on the software) the language code enclosed with brackets as mentioned in my previous message, to allow use the kodi language code workaround

CastagnaIT avatar Aug 27 '22 10:08 CastagnaIT

sorry sorry my browser went crazy and closed the thread and the message that i was writing, now reopened

CastagnaIT avatar Aug 27 '22 10:08 CastagnaIT

it's ok. I got it now. I thought the parentheses weren't needed before... So parentheses are required?

MAN-GOR avatar Aug 27 '22 10:08 MAN-GOR

yes as the screenshot example

CastagnaIT avatar Aug 27 '22 10:08 CastagnaIT

just to inform you that in my final changes in Kodi i made easier things for local files, so will be optional add the round brackets so if you prefeer you can add the language code in the track "title"/"name" also without brackets

CastagnaIT avatar Aug 28 '22 12:08 CastagnaIT