hugofara / lwt
Learn languages by reading, this is a community maintained version.
Fund package maintenance!
hugofara
Open Collective
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 188
Watchers: 2
Forks: 85
Open Issues: 3
pkg:composer/hugofara/lwt
Requires
- php: ^8.0 | ^8.1 | ^8.2
- ext-dom: *
- ext-mbstring: *
- ext-mysqli: *
Requires (Dev)
- league/commonmark: ^2.2
- matthiasmullie/minify: ^1.3
- phpunit/phpunit: ^10.0
- vimeo/psalm: ^5.6
Suggests
- squizlabs/php_codesniffer: Following code style standards is a good thing
README
Learn languages by reading texts you love
Learning with Texts (LWT) is a self-hosted web application for language learning through reading. Import any text, click unknown words to see translations, and build vocabulary with spaced repetition.
Important
This is a community-maintained fork with significant improvements over the official version: modern PHP support (8.1-8.4), smaller database footprint, mobile support, and active development.
Table of Contents
- Quick Start
- How It Works
- Features
- Installation
- Requirements
- Documentation
- Contributing
- Alternatives
- License
Quick Start
The fastest way to get started is with Docker:
git clone https://github.com/HugoFara/lwt.git
cd lwt
docker compose up
Then open http://localhost:8010/lwt/ in your browser.
How It Works
1. Import a text — Paste any content you want to read, or import from RSS feeds.
2. Read and learn — Unknown words are highlighted. Click any word to see its translation and save it to your vocabulary.
3. Review with context — Practice vocabulary with spaced repetition, always seeing words in their original context.
Unlike flashcard apps like Anki, LWT keeps words connected to the texts where you found them. We also include an Anki exporter if you want both.
Features
Core Features
- 40+ languages supported — Roman, right-to-left, and East-Asian writing systems
- Click-to-translate — Instant dictionary lookups while reading
- Audio integration — Sync audio tracks with your texts
- Spaced repetition — Review words at optimal intervals
- Progress tracking — Statistics to monitor your learning
Community Additions
This fork adds features not in the official LWT:
| Feature | Description |
|---|---|
| Mobile support | Responsive design for phones and tablets |
| RSS feeds | Automatically import texts from feeds |
| Themes | Customizable appearance |
| Multi-word selection | Click and drag to select phrases |
| Bulk translation | Translate multiple new words at once |
| Text-to-speech | Hear pronunciation of words |
| Keyboard shortcuts | Navigate efficiently while reading |
| Video embedding | Include videos from YouTube and other platforms |
| MeCab integration | Japanese word-by-word translation |
Technical Improvements
- Smaller database — Optimized schema reduces storage significantly
- Long expressions — Save phrases up to 250 characters (was limited to 9)
- Better search — Improved querying for words and texts
- Position memory — Resume reading where you left off
- Modern PHP — Supports PHP 8.1, 8.2, 8.3, and 8.4
Installation
Docker (Recommended)
Works on any OS with Docker installed.
Option A: Quick installer
# Use the lightweight installer git clone https://github.com/HugoFara/lwt-docker-installer.git cd lwt-docker-installer docker compose up
Option B: Build from source
git clone https://github.com/HugoFara/lwt.git
cd lwt
docker compose up
Access at http://localhost:8010/lwt/
Linux
# Download and extract the latest release wget https://github.com/HugoFara/lwt/archive/refs/heads/main.zip unzip main.zip && cd lwt-main # Run the installer chmod +x ./INSTALL.sh ./INSTALL.sh
Manual Installation (Windows/macOS/Linux)
-
Install prerequisites: PHP 8.1+, MySQL/MariaDB, a web server (Apache/Nginx)
-
Clone or download the repository
-
Configure the database:
cp .env.example .env # Edit .env with your database credentials -
Install dependencies:
composer install npm install && npm run build:all
See the Installation Guide for detailed instructions.
Requirements
| Component | Version |
|---|---|
| PHP | 8.1, 8.2, 8.3, or 8.4 |
| MySQL/MariaDB | 5.7+ / 10.3+ |
| PHP Extensions | mysqli, mbstring, dom |
For development, you'll also need Composer and Node.js 18+.
Documentation
- User Guide — Getting started and usage
- API Reference — Features and REST API documentation
- Developer Docs — Architecture and contribution guide
Contributing
Contributions are welcome! Here's how to set up a development environment:
git clone https://github.com/HugoFara/lwt.git
cd lwt
composer install --dev
npm install
Development Commands
# Run tests composer test # PHP tests with coverage npm test # Frontend tests # Code quality ./vendor/bin/psalm # Static analysis npm run lint # ESLint npm run typecheck # TypeScript checking # Build assets npm run dev # Development server with HMR npm run build:all # Production build
Branch Strategy
| Branch | Purpose |
|---|---|
main |
Stable releases |
dev |
Development and testing |
official |
Tracks official LWT releases |
Alternatives
If LWT doesn't fit your needs, consider these projects:
- LUTE v3 — Modern rewrite using Python/Flask, actively developed
- LinguaCafe — Beautiful Vue.js/PHP implementation
- FLTR — Java desktop app by LWT's original author
License
This project is released into the public domain under the Unlicense. You're free to use, modify, and distribute it however you like.
Happy reading, happy learning!


