mrmuminov / php-i18n
A PHP library for internationalization
1.3.2
2022-08-20 19:02 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: ^4
README
A PHP library for internationalization
Installation
composer require mrmuminov/php-i18n
or add the following to your composer.json
:
{ "require": { "mrmuminov/php-i18n": "^v1.0" } }
Usage
<?php require '../vendor/autoload.php'; $i18n = new \MrMuminov\PhpI18n\I18n([ 'languages' => ['en', 'uz'], 'language' => 'en', ]); echo $i18n->get('Home'); // Output: "Home" echo $i18n->get('Hello %s', 'Bahriddin'); // Output: "Hello Bahriddin" // Set language to uz $i18n->setLanguage('uz'); echo $i18n->get('Hello %s', 'Bahriddin'); // Output: "Salom Bahriddin"