Skip to content

feat: replace fast-langdetect with lingua-language-detector#21

Merged
fmueller merged 1 commit intomainfrom
feat/change-language-detection-library
Feb 3, 2026
Merged

feat: replace fast-langdetect with lingua-language-detector#21
fmueller merged 1 commit intomainfrom
feat/change-language-detection-library

Conversation

@fmueller
Copy link
Owner

Migrate language detection from fast-langdetect + fasttext-predict to lingua-language-detector (Rust/PyO3). This eliminates the NumPy copy-error workaround, removes runtime model downloads, and enables Python 3.13/3.14 support.

  • Replace dependencies in pyproject.toml, add 3.13/3.14 classifiers
  • Rewrite _default_language_detector in language.py to use lingua
  • Rewrite _create_language_detector in postedit.py, remove fasttext workaround methods and unused imports
  • Remove fasttext logger suppression and download patching from translate_cli.py
  • Update tests to mock lingua instead of fast-langdetect
  • Bump .python-version to 3.13, update CI matrix to [3.10, 3.13]

Migrate language detection from fast-langdetect + fasttext-predict to
lingua-language-detector (Rust/PyO3). This eliminates the NumPy
copy-error workaround, removes runtime model downloads, and enables
Python 3.13/3.14 support.

- Replace dependencies in pyproject.toml, add 3.13/3.14 classifiers
- Rewrite _default_language_detector in language.py to use lingua
- Rewrite _create_language_detector in postedit.py, remove fasttext
  workaround methods and unused imports
- Remove fasttext logger suppression and download patching from
  translate_cli.py
- Update tests to mock lingua instead of fast-langdetect
- Bump .python-version to 3.13, update CI matrix to [3.10, 3.13]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@fmueller fmueller merged commit 8af9fcf into main Feb 3, 2026
3 checks passed
@fmueller fmueller deleted the feat/change-language-detection-library branch February 3, 2026 09:08
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.

1 participant