Arabic Toolkit
Arabic Toolkit is a Drupal 10/11 foundation module that provides reusable services for Arabic language processing. Other modules, themes, and site builders can inject these services instead of reimplementing Arabic text handling.
It solves common problems on Arabic-language sites: Alef variants that break search, Tatweel and diacritics that fragment indexes, mixed RTL/LTR text, and quality issues such as invisible Unicode characters or Latin punctuation in Arabic content.
Features
- Arabic text normalization — configurable rules for Alef variants, Tatweel (Kashida), diacritics, invisible Unicode characters, and whitespace.
- Text direction detection — RTL, LTR, mixed, or unknown.
- Text analysis — detects Arabic script, Latin script, Tatweel, diacritics, and mixed direction.
- Text auditing — typed findings for unnormalized characters, invisible characters, incorrect punctuation, multiple spaces, and mixed direction.
- Number formatting — converts between Latin digits (0–9) and Arabic-Indic digits (٠–٩).
- Twig filters —
arabic_digits,latin_digits,arabic_normalize,text_direction. - Drush commands —
arabic:normalize,arabic:analyze,arabic:audit,arabic:info. - Optional Search API integration — the
arabic_searchsubmodule provides an Arabic Text Normalization processor. Search API is not required to use the main module.
Post-Installation
- Enable the module:
drush en arabic_toolkit -y - Inject services such as
arabic_toolkit.normalizerin custom code, or use the Twig filters in templates. - Optional: enable Search API integration with
drush en arabic_search -y, then add the Arabic Text Normalization processor on your Search API index and reindex.
Default normalization is conservative: Alef, Tatweel, diacritics, and whitespace are normalized. Yeh and Teh Marbuta are off by default because they can change word meaning.
Additional Requirements
- PHP 8.3+
- Drupal 10.3 or 11
- Search API — only if you enable the
arabic_searchsubmodule - Drush — only if you want the CLI commands
Recommended modules
- Search API — use the bundled
arabic_searchprocessor to normalize Arabic content before indexing.
Similar projects
- Ar-PHP — wraps the Ar-PHP library (tags, calendars, filename transliteration). Arabic Toolkit is a modern Drupal service API with no external library and optional Search API support.
- Hijri Dates — Hijri calendar display. Out of scope for Arabic Toolkit.
- CKEditor BiDi Buttons — editor toolbar for RTL/LTR. Complements this module; does not normalize or audit text.
Supporting this Module
File issues and merge requests on the project page. Contributions that follow Drupal Coding Standards are welcome.
Community Documentation
See the project README after the first release is tagged. Installation, services, Twig filters, Search API setup, and Drush commands are documented there.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.0-alpha1 | Pre-release | 10–11 | Sep 5, 2026 |