This package provides a comprehensive solution for converting numbers into Kurdish Sorani words, making it easier to work with numbers in applications that require Kurdish language support. Convert English numbers to Kurdish Sorani text, currency, time, ordinal, percentage, and more.
hamoi1/kurdish-converter is a Laravel package for this package provides a comprehensive solution for converting numbers into kurdish sorani words, making it easier to work with numbers in applications that require kurdish language support. convert english numbers to kurdish sorani text, currency, time, ordinal, percentage, and more..
It currently has 1 GitHub stars and 1 downloads on Packagist.
Install it with composer require hamoi1/kurdish-converter.
Discover more Laravel packages by hamoi1
or browse all Laravel packages to compare alternatives.
Last updated
🌟 A comprehensive PHP package for converting numbers, currencies, time, and more into Kurdish Sorani language 🌟
Kurdish Converter is a powerful Laravel package that provides seamless conversion of numbers, currencies, time formats, ordinals, and percentages into beautiful Kurdish Sorani text. Perfect for applications targeting Kurdish-speaking users, this package makes it easy to localize your numeric data.
Install the package via Composer:
composer require hamoi1/kurdish-converter
The package will automatically register its service provider. If you need to register it manually, add it to your config/app.php:
'providers' => [
// ...
Hamoi1\KurdishConverter\KurdishConverterServiceProvider::class,
],
php artisan vendor:publish --provider="Hamoi1\KurdishConverter\KurdishConverterServiceProvider"
use Hamoi1\KurdishConverter\Services\KurdishServiceConverter;
// Convert numbers to Kurdish words
echo KurdishServiceConverter::convertToWords(123);
// Output: سەد و بیست و سێ
// Convert digits to Kurdish/Arabic numerals
echo KurdishServiceConverter::convertDigits(12345);
// Output: ١٢٣٤٥
// Format currency
echo KurdishServiceConverter::formatCurrency(1500, 'IQD');
// Output: هەزار و پێنج سەد دینار
// Convert time
echo KurdishServiceConverter::formatTime('14:30');
// Output: چواردە و نیو
// Format percentage
echo KurdishServiceConverter::formatPercentage(0.75);
// Output: لە دەیا حەفتا و پێنج
// Convert to ordinal
echo KurdishServiceConverter::convertToOrdinal(3);
// Output: سێیەم
// If you want to use it as a facade
app('kurdish')->convertToWords(456);
// Convert integers and floats to Kurdish words
KurdishServiceConverter::convertToWords(123); // سەد و بیست و سێ
KurdishServiceConverter::convertToWords(123.45); // سەد و بیست و سێ و چەند
// Convert English digits to Kurdish/Arabic numerals
KurdishServiceConverter::convertDigits('2024'); // ٢٠٢٤
KurdishServiceConverter::convertDigits(3.14); // ٣.١٤
// Format monetary amounts
KurdishServiceConverter::formatCurrency(1000); // هەزار دینار
KurdishServiceConverter::formatCurrency(500, 'USD'); // پێنج سەد دۆلار
// Convert time to Kurdish format
KurdishServiceConverter::formatTime('09:15'); // نۆ و چارەک
KurdishServiceConverter::formatTime('12:30'); // دوانزە و نیو
KurdishServiceConverter::formatTime('18:45'); // هەژدە و سێ چارەک
// Format percentages
KurdishServiceConverter::formatPercentage(0.25); // لە دەیا بیست و پێنج
KurdishServiceConverter::formatPercentage(1.5); // یەک پەڕسەنت و نیو
// Convert to ordinal format
KurdishServiceConverter::convertToOrdinal(1); // یەکەم
KurdishServiceConverter::convertToOrdinal(2); // دووەم
KurdishServiceConverter::convertToOrdinal(21); // بیست و یەکیەم
The package includes configurable currency names. After publishing the config file, you can customize currency mappings in config/kurdish-converter.php:
return [
'currency_names' => [
'IQD' => 'دینار',
'USD' => 'دۆلار',
'EUR' => 'یۆرۆ',
// Add more currencies as needed
],
];
The package includes built-in safety measures:
try {
$result = KurdishServiceConverter::convertToWords(999999999999999);
} catch (\InvalidArgumentException $e) {
echo "Error: " . $e->getMessage();
}
The package includes comprehensive tests covering all functionality.
Run all tests:
composer test
Run tests with coverage:
composer test-coverage
Run specific test suites:
# Run only unit tests
./vendor/bin/pest tests/Unit
# Run only feature tests
./vendor/bin/pest tests/Feature
The package includes:
We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
composer installcomposer testThis package is open-sourced software licensed under the MIT license.
Muhammad Esmael
Made with ❤️ by Muhammad Esmael
Support Kurdish Language in Technology! 🌟