Skip to content

Feat: Chinese character converter#893

Draft
Luc-Mcgrady wants to merge 2 commits intokillergerbah:mainfrom
Luc-Mcgrady:main
Draft

Feat: Chinese character converter#893
Luc-Mcgrady wants to merge 2 commits intokillergerbah:mainfrom
Luc-Mcgrady:main

Conversation

@Luc-Mcgrady
Copy link

This would probably have been better as a git issue than as a pull request; but I was wondering if you would be ok with/interested in an option to automatically convert Chinese characters between simplified and traditional.

image image image

This change seems to increase the size of the extension by >1mb which isn't fantastic...

Anyway let me know what you think. If it's ok with you I will try to make a UI for it.

@Luc-Mcgrady Luc-Mcgrady changed the title Added: Converter code Feat: Chinese character converter Feb 22, 2026
@killergerbah
Copy link
Owner

killergerbah commented Feb 23, 2026

Appreciate the PR but hesitant to put this in for these reasons:

  • This is a language-specific feature while currently asbpayer has little awareness of the user's target language. I think something like this makes more sense once we have more language-specific features.
  • It would be convenient for asbplayer to convert the characters but it feels like asbplayer is providing very little value here other than making that function call. It might make more sense or as some kind of external plugin that converts subtitle files and loads them via asbplayer's WebSocket interface.
  • As you said it increases the size of the bundle significantly. If not for this then I'd lean closer towards just including it.

@Luc-Mcgrady
Copy link
Author

Makes sense to me. Thanks for the feedback.

It might make more sense or as some kind of external plugin that converts subtitle files and loads them via asbplayer's WebSocket interface.

I'd like this but my current problem would be that it is quite cumbersome to download the subtitle files, for example, with youtube-dl.

Maybe there could be some way to download the currently selected subtitle to re-upload a modified version via the websocket? Maybe there could even be a way for the websocket to announce that a new subtitle has been loaded, then any interested listeners could make the expensive call to fetch the subtitles.

Is this something you might be keen on including in the scripts folder?

As you said it increases the size of the bundle significantly. If not for this then I'd lean closer towards just including it.

I could try and make it so that the user uploads whatever dictionary they would like to use. I would imagine this would solve the size problem.

Anyway, If all else fails I can just keep using my fork :)

@killergerbah
Copy link
Owner

Maybe there could be some way to download the currently selected subtitle to re-upload a modified version via the websocket? Maybe there could even be a way for the websocket to announce that a new subtitle has been loaded, then any interested listeners could make the expensive call to fetch the subtitles.

Actually this seems like a really great use case for the websocket server. We could provide a way to query the currently loaded subtitles. Then anybody interested could just poll for changes and transform the subs however they wish.

@killergerbah
Copy link
Owner

If we do this i'd prefer to extend the anki plugin that @mwojick wrote though

@Luc-Mcgrady
Copy link
Author

Luc-Mcgrady commented Feb 23, 2026

Actually this seems like a really great use case for the websocket server. We could provide a way to query the currently loaded subtitles. Then anybody interested could just poll for changes and transform the subs however they wish.

Just going to check, do you mean the file or the currently displayed subtitles. Would the web-socket from the client send a message to the server only once when the subtitles are loaded, or once per new subtitle node is displayed (and have the subtitle text updated as the video is playing)?

If we do this i'd prefer to extend the anki plugin that @mwojick wrote though

So we keep a constant store of the current subtitles in the anki plugin, let it be polled by third party apps, and then when the subtitles are updated send them back to the client?

@killergerbah
Copy link
Owner

Just going to check, do you mean the file or the currently displayed subtitles. Would the web-socket from the client send a message to the server only once when the subtitles are loaded, or once per new subtitle node is displayed (and have the subtitle text updated as the video is playing)?

I was just thinking of providing a way to query the current subtitle file and its contents via an HTTP endpoint. Pushing subtitle events could be cool too but currently the only supported client of the websocket server is asbplayer itself. Not sure how complicated it would be to support other types of clients.

So we keep a constant store of the current subtitles in the anki plugin, let it be polled by third party apps, and then when the subtitles are updated send them back to the client?

Yeah something like that but unsure of the details atm

@killergerbah
Copy link
Owner

Looks like @bpwhelan created an issue for this already: #840

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants