Multi lingual text - #1
Draft
mikklee wants to merge 10 commits into
Draft
Conversation
added 10 commits
May 24, 2026 12:52
This should support most languages available on Youtube
Enables an option to parse relative time strings in video metadata for non-English languages.
Makes it easier to see that something went wrong during the parsing. When null, default to 1. This is for edge cases like 'A year ago'.
This was a stowaway from a previous commit
No point in those being part of the separate hanzi/kanji-relevant logic Also removes some ranges from the isHan check that were not relevant to that function to begin with. Eg. Thai.
Adds isRelativeTime helper for multilingual support
This function detects relative time strings across multiple languages..
It replaces the `endsWith('ago')` check in the local API when the
experimental multilingual setting is enabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE! This PR has a lot of lines mainly due to adding Jest and extensive tests.
Pull Request Type
Related issue
FreeTubeApp#2590
Description
Implements an experimental feature that let's you override the lang setting for the Innertube client:
Screenshots
Will be added soon
Testing
Tests
I have added extensive tests for the relative time logic. This however adds more dev dependencies, so I'd also like feedback on whether this is okay to contribute.
Testing the feature
Experimental Multilingual Text ParsingDesktop
Additional context
This is still work in progress (WIP). Need to iron out potential issues.
Feedback is appreciated.
Alternatives
This is based on the logic I used for my own youtube client, so I have considered other alternatives.
Feel free to explore them however.
enlang, and then with the preferred lang.Tasks remaning: