Skip to content

ahmedalmnsour/khitab

English | العربية

khitab

License: MIT CI TypeScript Alpha

Ready-made, gender-aware Arabic phrases for UI text. Lightweight, TypeScript-first, framework-agnostic.

This English README is a short gateway. The full documentation, including philosophy, both interfaces, limits, and the inclusivity guide, lives in the Arabic README, the project's heart.

What is khitab?

Arabic verbs and many sentences change form depending on whom you address: احفظ to a man, احفظي to a woman. Most UIs ignore this and default to the masculine. khitab is a small dictionary plus a tiny function that returns the correctly-addressed Arabic phrase for a given gender, so your interface speaks to each user properly.

It ships 1367 reviewed phrases (780 gendered, 587 naturally neutral) across a core set and ten domains, has zero runtime dependencies, and is fully typed.

khitab dictionary: 1367 phrases — 780 gendered (57%), 587 neutral (43%)

Install

npm install @khitab/core@alpha

The @alpha tag is intentional: the library is currently in its alpha stage, and typing alpha yourself is a conscious acknowledgment of that. Once it reaches stability, the plain install will become the recommended one, in shaa' Allah.

Quick start

import { khitab, createKhitab } from '@khitab/core';

// Simple, stateless — recommended for servers. `gender` is required.
khitab('save', 'male'); //   احفظ
khitab('save', 'female'); // احفظي

// Factory — for LOCAL scope only (a component or a request handler).
const k = createKhitab({ defaultGender: 'female' });
k('login'); // سجّلي الدخول

See examples/basic.ts for the neutral-fallback and error behaviors.

⚠️ Alpha

This is an alpha release (published to npm under the alpha tag): the phrase dictionary is complete and reviewed, but the library has not yet been tested in real-world projects. The API may change before a stable release.

Full documentation

The complete guide is in the Arabic README. It covers the philosophy behind gender-aware addressing, the simple vs. factory interfaces in depth, an honest account of the library's limits, the SSR warning, and how to contribute toward full inclusivity.

License

MIT © 2026 Ahmed Almnsour

About

Gender-aware Arabic phrases for UIs | صيغ المخاطبة العربية للواجهات

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors