vicent/laque-swahil-locale
最新稳定版本:v1.0.0
Composer 安装命令:
composer require vicent/laque-swahil-locale
包简介
Swahili locale helpers: ICU-based dates/numbers, lightweight inflector, terminology dictionary, and optional PSR-15 locale negotiation. Framework-agnostic, SOLID.
README 文档
README
Framework‑agnostic, SOLID PHP library for Swahili localization:
- ICU/intl date, time, number, and currency formatting (with PHP fallback)
- Lightweight Swahili inflector (noun classes + passive verbs for UX)
- Terminology dictionary (Sw ↔ En)
- Optional PSR‑15 locale negotiation middleware
Author: Vicent Msomi msomivicent@gmail.com
Install
composer require vicent/laque-swahil-locale
Quick start
use Laque\SwahiliLocale\Locale\DateNumber\IntlDateNumberFormatter; use Laque\SwahiliLocale\Locale\Inflection\SwahiliInflector; use Laque\SwahiliLocale\Locale\Terms\Terminology; use Laque\SwahiliLocale\Locale\Terms\PhpFileLoader; $fmt = class_exists(\NumberFormatter::class) ? new IntlDateNumberFormatter('sw_TZ') : new Laque\SwahiliLocale\Locale\DateNumber\FallbackDateNumberFormatter('sw_TZ'); $infl = new SwahiliInflector(['mtumiaji'=>'watumiaji']); $terms = new Terminology(new PhpFileLoader(__DIR__.'/resources/terms')); echo $fmt->formatCurrency(1250000, 'TZS'); echo $infl->pluralizeNoun('kifurushi', 3); echo $terms->translate('Jina Kamili', 'sw_TZ', 'en_US');
MIT © 2025 Vicent Msomi
Packagist Auto-Update
- After publishing to GitHub, submit the repo to Packagist.
- In Packagist (Maintainer settings), enable GitHub Hook so new tags push updates automatically.
- Alternatively, create a Packagist API token and set up a GitHub Action to ping Packagist on tag (optional).
Examples
Run from repo root after composer install:
php examples/formatting.php php examples/inflection.php php examples/terminology.php php examples/middleware-demo.php
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-13