chore(scripts): replace cld with franc to detect language #25538
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.
Description
The
cld
package works well, but it requires the user to install MSVC to compile the C source code. But some contributors may not be C/C++ developers, and they don't want to install such a heavy compiler on their computers (MSVC build tools requires 8GB of disk space). Additionally, thecld
package itself requires 100MB of disk space (see the warning).After comparing with some language detectors (cld, franc, cld3-asm), I believe
franc
is a well substitute for us, as it has more users and is lighter (implemented in pure javascript).Note that, the replacement will increase the time used for language detection. I've tested to run through all the files:
Motivation
Makes it easier for contributors (especially for Windows users) to setup the environment.