rnurdaulet / qazaqify
Kazakh localization for PHP
v0.1.0
2026-09-04 10:21 UTC
Requires
- php: ^8.2
Requires (Dev)
- phpunit/phpunit: ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-04 10:50:55 UTC
README
Kazakh formatting and localization for PHP.
Dates, numbers, currency, relative time, units, and UI formatting for PHP.
You don't have to build Kazakh UI text with sprintf('%d күн бұрын', $days). Call a function and get ready-to-use text.
Installation
composer require rnurdaulet/qazaqify
Usage
use DateTimeImmutable; use Qazaqify\Formatter; use Qazaqify\Style; use function Qazaqify\qazaqify; $t = new DateTimeImmutable('2026-09-04 14:30:00'); $q = qazaqify(); // or: new Formatter() $q->formatDate($t, Style::Long); // "2026 ж. 4 қыркүйек" $q->formatTime($t, Style::Short); // "14:30" $q->formatDateTime($t); // "4 қыркүйек 2026, 14:30" $q->relativeTime($t); // "5 минут бұрын" $q->calendar($t, new DateTimeImmutable()); // "бүгін, 14:30" $q->formatInterval($from, $to); // "2026 ж. 4–10 қыркүйек" $q->number(1234567.89); // "1 234 567,89" $q->currency(12500, 'KZT'); // "12 500 ₸" $q->currencyWords(12500); // "он екі мың бес жүз теңге" $q->percent(0.75); // "75%" $q->unit(1500, 'meter'); // "1,5 км" $q->bytes(1536000); // "1,5 МБ" $q->duration(3665); // "1 сағат 1 минут 5 секунд" $q->humanDuration(3665); // "шамамен 1 сағат" $q->ordinal(21); // "21-ші" $q->words(123); // "жүз жиырма үш" $q->join(['Алма', 'алмұрт', 'өрік']); // "Алма, алмұрт және өрік" $q->message('{count} жаңа хабарлама', ['count' => 5]); // "5 жаңа хабарлама"
Features
- Date and time formatting
- Relative time
- Date and time intervals
- Calendar helpers
- Number formatting
- Numbers in words
- Ordinal numbers
- Currency formatting
- Percentages
- Units and byte sizes
- Durations
- List formatting
- Simple message formatting
- Kazakh locale data
Development
composer test
License
MIT License